Skip to content

Commit

Permalink
Merge branch 'api6'
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlan-00 committed Aug 30, 2023
2 parents 4d56560 + fc7a851 commit d64fd3c
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/json-responses/system_preference.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": 123,
"name": "ajax_load",
"level": 25,
"description": "Ajax page load",
"value": "1",
"type": "boolean",
"category": "interface",
"subcategory": null
}
10 changes: 10 additions & 0 deletions docs/json-responses/user_preference.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": 123,
"name": "ajax_load",
"level": 25,
"description": "Ajax page load",
"value": "1",
"type": "boolean",
"category": "interface",
"subcategory": null
}
12 changes: 12 additions & 0 deletions docs/xml-responses/system_preference.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<preference id="123">
<name><![CDATA[ajax_load]]></name>
<level>25</level>
<description><![CDATA[Ajax page load]]></description>
<value>1</value>
<type><![CDATA[boolean]]></type>
<category><![CDATA[interface]]></category>
<subcategory><![CDATA[]]></subcategory>
</preference>
</root>
12 changes: 12 additions & 0 deletions docs/xml-responses/user_preference.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<preference id="123">
<name><![CDATA[ajax_load]]></name>
<level>25</level>
<description><![CDATA[Ajax page load]]></description>
<value>1</value>
<type><![CDATA[boolean]]></type>
<category><![CDATA[interface]]></category>
<subcategory><![CDATA[]]></subcategory>
</preference>
</root>
2 changes: 1 addition & 1 deletion src/_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"""

__author__ = "Lachlan de Waard (lachlan-00)"
__version__ = "6.0.1"
__version__ = "6.1.0"

DEBUG = False
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 d64fd3c

Please sign in to comment.