def play_key(self, key, offset=0): server = self._plex.server item = video.list_items(server, key, video.Episode.TYPE) if not item: raise Exception() item = item[0] self.play_video(item, offset)
def _secondary_list(self, key, input=None): choices = list_choices(self.server, '/library/sections/%s/%s' % (self.key, key)) if not input: return choices.keys() return video.list_items( self.server, '/library/sections/%s/%s/%s' % (self.key, key, choices[input]))
def search(self, title, filter='all', vtype=None, **tags): """ Search all available content. title: Title to search (pass None to search all titles). filter: One of {'all', 'onDeck', 'recentlyAdded'}. videotype: One of {'movie', 'show', 'season', 'episode'}. tags: One of {country, director, genre, producer, actor, writer}. """ args = {} if title: args['title'] = title if vtype: args['type'] = video.search_type(vtype) for tag, obj in tags.iteritems(): args[tag] = obj.id query = '/library/%s%s' % (filter, utils.joinArgs(args)) return video.list_items(self.server, query)
def search(self, title, filter='all', vtype=None, **tags): """ Search section content. title: Title to search (pass None to search all titles). filter: One of {'all', 'newest', 'onDeck', 'recentlyAdded', 'recentlyViewed', 'unwatched'}. videotype: One of {'movie', 'show', 'season', 'episode'}. tags: One of {country, director, genre, producer, actor, writer, decade, year, contentRating, <etc>}. """ args = {} if title: args['title'] = title if vtype: args['type'] = video.search_type(vtype) for tag, obj in tags.items(): args[tag] = obj.id query = '/library/sections/%s/%s%s' % (self.key, filter, utils.joinArgs(args)) return video.list_items(self.server, query)
def _primary_list(self, key): return video.list_items(self.server, '/library/sections/%s/%s' % (self.key, key))
def recentlyAdded(self): return video.list_items(self.server, '/library/recentlyAdded')
def all(self): return video.list_items(self.server, '/library/all')
def onDeck(self): return video.list_items(self.server, '/library/onDeck')
def sessions(self): return video.list_items(self, '/status/sessions')
def _secondary_list(self, key, input=None): choices = list_choices(self.server, '/library/sections/%s/%s' % (self.key, key)) if not input: return choices.keys() return video.list_items(self.server, '/library/sections/%s/%s/%s' % (self.key, key, choices[input]))
def getMedia(self): server = self.server().connect() items = list_items(server, '/sync/items/{0}'.format(self.id)) return items
def search(self, query, videotype=None): query = urllib.quote(query) items = video.list_items(self, '/search?query=%s' % query) if videotype: return [item for item in items if item.type == videotype] return items
def search(self, query, videotype=None): query = quote(query) items = video.list_items(self, '/search?query=%s' % query) if videotype: return [item for item in items if item.type == videotype] return items