Skip to content

Commit

Permalink
add catalog_folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlan-00 committed Aug 28, 2023
1 parent 0d8dcca commit 1c2e18a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/ampache.py
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,32 @@ def catalog_file(self, file, task, catalog_id):
return False
return self.return_data(ampache_response)

def catalog_folder(self, folder, task, catalog_id):
""" catalog_folder
MINIMUM_API_VERSION=6.0.0
Perform actions on local catalog folders.
Single folder versions of catalog add, clean and verify.
Make sure you remember to urlencode those folder names!
INPUTS
* folder = (string) urlencode(FULL path to local folder)
* task = (string) 'add'|'clean'|'verify'|'remove'
* catalog_id = (integer) $catalog_id
"""
ampache_url = self.AMPACHE_URL + '/server/' + self.AMPACHE_API + '.server.php'
data = {'action': 'catalog_folder',
'auth': self.AMPACHE_SESSION,
'folder': folder,
'task': task,
'catalog': catalog_id}
data = urllib.parse.urlencode(data)
full_url = ampache_url + '?' + data
ampache_response = self.fetch_url(full_url, self.AMPACHE_API, 'catalog_action')
if not ampache_response:
return False
return self.return_data(ampache_response)

def podcasts(self, filter_str: str = False,
exact: int = False, offset=0, limit=0):
""" podcasts
Expand Down

0 comments on commit 1c2e18a

Please sign in to comment.