mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 06:04:15 +00:00
Add searchAudio() method to Library
It will only search for audio content (Track, Album, Artist)
This commit is contained in:
parent
1e28eebbf6
commit
9ca97c5fac
1 changed files with 16 additions and 0 deletions
|
@ -65,6 +65,22 @@ class Library(object):
|
|||
query = '/library/%s%s' % (filter, utils.joinArgs(args))
|
||||
return video.list_items(self.server, query)
|
||||
|
||||
def searchAudio(self, title, filter='all', atype=None, **tags):
|
||||
""" Search all available audio content.
|
||||
title: Title to search (pass None to search all titles).
|
||||
filter: One of {'all', 'onDeck', 'recentlyAdded'}.
|
||||
atype: One of {'artist', 'album', 'track'}.
|
||||
tags: One of {country, director, genre, producer, actor, writer}.
|
||||
"""
|
||||
args = {}
|
||||
if title: args['title'] = title
|
||||
if atype: args['type'] = audio.search_type(atype)
|
||||
for tag, obj in tags.items():
|
||||
args[tag] = obj.id
|
||||
query = '/library/%s%s' % (filter, utils.joinArgs(args))
|
||||
return audio.list_items(self.server, query)
|
||||
|
||||
|
||||
def cleanBundles(self):
|
||||
self.server.query('/library/clean/bundles')
|
||||
|
||||
|
|
Loading…
Reference in a new issue