Skip to content

Commit d797b0b

Browse files
committed
add date to flag
1 parent 0536afe commit d797b0b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/ampache.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2675,7 +2675,7 @@ def rate(self, object_type, object_id, rating):
26752675
return False
26762676
return self.return_data(ampache_response)
26772677

2678-
def flag(self, object_type, object_id, flagbool):
2678+
def flag(self, object_type, object_id, flagbool, date=False):
26792679
""" flag
26802680
MINIMUM_API_VERSION=400001
26812681
@@ -2688,6 +2688,7 @@ def flag(self, object_type, object_id, flagbool):
26882688
* object_type = (string) 'song'|'album'|'artist'
26892689
* object_id = (integer) $object_id
26902690
* flagbool = (boolean|integer) (True,False | 0|1)
2691+
* date = (integer) UNIXTIME() //optional
26912692
"""
26922693
if bool(flagbool):
26932694
flag_state = 1
@@ -2698,7 +2699,10 @@ def flag(self, object_type, object_id, flagbool):
26982699
'auth': self.AMPACHE_SESSION,
26992700
'type': object_type,
27002701
'id': object_id,
2701-
'flag': flag_state}
2702+
'flag': flag_state,
2703+
'date': date}
2704+
if not date:
2705+
data.pop('date')
27022706
data = urllib.parse.urlencode(data)
27032707
full_url = ampache_url + '?' + data
27042708
ampache_response = self.fetch_url(full_url, self.AMPACHE_API, 'flag')
@@ -3993,3 +3997,4 @@ def user_update(self, username, password=False, fullname=False, email=False,
39933997
return self.user_edit(username, password, fullname, email,
39943998
website, state, city, disable, maxbitrate,
39953999
fullname_public, reset_apikey, reset_streamtoken, clear_stats)
4000+

0 commit comments

Comments
 (0)