Skip to content

Commit 0536afe

Browse files
committed
user_id is also optional
1 parent 0231613 commit 0536afe

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/ampache.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2706,7 +2706,7 @@ def flag(self, object_type, object_id, flagbool):
27062706
return False
27072707
return self.return_data(ampache_response)
27082708

2709-
def record_play(self, object_id, user_id, client='python3-ampache', date=False):
2709+
def record_play(self, object_id, user_id=False, client='python3-ampache', date=False):
27102710
""" record_play
27112711
MINIMUM_API_VERSION=400001
27122712
@@ -2715,7 +2715,7 @@ def record_play(self, object_id, user_id, client='python3-ampache', date=False):
27152715
27162716
INPUTS
27172717
* object_id = (integer) $object_id
2718-
* user_id = (integer) $user_id
2718+
* user_id = (integer) $user_id //optional
27192719
* client = (string) $agent //optional
27202720
* date = (integer) UNIXTIME() //optional
27212721
"""
@@ -2726,6 +2726,8 @@ def record_play(self, object_id, user_id, client='python3-ampache', date=False):
27262726
'user': user_id,
27272727
'client': client,
27282728
'date': date}
2729+
if not user_id:
2730+
data.pop('user')
27292731
if not date:
27302732
data.pop('date')
27312733
data = urllib.parse.urlencode(data)

0 commit comments

Comments
 (0)