Skip to content

Commit

Permalink
use playlist_name to match other methods
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlan-00 committed Oct 7, 2024
1 parent ab46011 commit 472c654
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/ampache.py
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,7 @@ def playlist_create(self, playlist_name, playlist_type):
return False
return self.return_data(ampache_response)

def playlist_edit(self, filter_id: int, name=False,
def playlist_edit(self, filter_id: int, playlist_name=False,
playlist_type=False, owner=False, items=False, tracks=False):
""" playlist_edit
MINIMUM_API_VERSION=400001
Expand All @@ -1526,22 +1526,22 @@ def playlist_edit(self, filter_id: int, name=False,
INPUTS
* filter_id = (integer)
* name = (string) playlist name //optional
* playlist_name = (string) playlist name //optional
* playlist_type = (string) 'public'|'private' //optional
* owner = (string) Change playlist owner to the user id (-1 = System playlist) //optional
* items = (string) comma-separated song_id's (replaces existing items with a new id) //optional
* tracks = (string) comma-separated playlisttrack numbers matched to 'items' in order //optional
* owner = (string) Change playlist owner to the user id (-1 = System playlist) //optional
* items = (string) comma-separated song_id's (replaces existing items with a new id) //optional
* tracks = (string) comma-separated playlisttrack numbers matched to 'items' in order //optional
"""
ampache_url = self.AMPACHE_URL + '/server/' + self.AMPACHE_API + '.server.php'
data = {'action': 'playlist_edit',
'auth': self.AMPACHE_SESSION,
'filter': filter_id,
'name': name,
'name': playlist_name,
'type': playlist_type,
'owner': owner,
'items': items,
'tracks': tracks}
if not name:
if not playlist_name:
data.pop('name')
if not playlist_type:
data.pop('type')
Expand Down Expand Up @@ -4503,8 +4503,8 @@ def execute(self, method: str, params=None):
case 'playlist_delete':
return self.playlist_delete(params["filter_id"])
case 'playlist_edit':
if not "name" in params:
params["name"] = False
if not "playlist_name" in params:
params["playlist_name"] = False
if not "playlist_type" in params:
params["playlist_type"] = False
if not "owner" in params:
Expand All @@ -4513,7 +4513,7 @@ def execute(self, method: str, params=None):
params["items"] = False
if not "tracks" in params:
params["tracks"] = False
return self.playlist_edit(params["filter_id"], params["name"], params["playlist_type"],
return self.playlist_edit(params["filter_id"], params["playlist_name"], params["playlist_type"],
params["owner"], params["items"], params["tracks"])
case 'playlist_generate':
if not "mode" in params:
Expand Down

0 comments on commit 472c654

Please sign in to comment.