Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix preference methods returning all the preferences #13

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/ampache.py
Original file line number Diff line number Diff line change
Expand Up @@ -2766,15 +2766,15 @@ def user_preference(self, filter_str):
Returns preference based on the specified filter_str

INPUTS
* filter_str = (string) search the name of a preference //optional
* filter_str = (string) search the name of a preference
"""
ampache_url = self.AMPACHE_URL + '/server/' + self.AMPACHE_API + '.server.php'
data = {'action': 'user_preferences',
data = {'action': 'user_preference',
'auth': self.AMPACHE_SESSION,
'filter': filter_str}
data = urllib.parse.urlencode(data)
full_url = ampache_url + '?' + data
ampache_response = self.fetch_url(full_url, self.AMPACHE_API, 'user_preferences')
ampache_response = self.fetch_url(full_url, self.AMPACHE_API, 'user_preference')
if not ampache_response:
return False
return self.return_data(ampache_response)
Expand Down Expand Up @@ -2804,15 +2804,15 @@ def system_preference(self, filter_str):
Returns preference based on the specified filter_str

INPUTS
* filter_str = (string) search the name of a preference //optional
* filter_str = (string) search the name of a preference
"""
ampache_url = self.AMPACHE_URL + '/server/' + self.AMPACHE_API + '.server.php'
data = {'action': 'system_preferences',
data = {'action': 'system_preference',
'auth': self.AMPACHE_SESSION,
'filter': filter_str}
data = urllib.parse.urlencode(data)
full_url = ampache_url + '?' + data
ampache_response = self.fetch_url(full_url, self.AMPACHE_API, 'system_preferences')
ampache_response = self.fetch_url(full_url, self.AMPACHE_API, 'system_preference')
if not ampache_response:
return False
return self.return_data(ampache_response)
Expand Down