def search(self, query, sort_fields=[], return_lim=-1, tracks=None, reverse=False): """ DEPRECATED, DO NOT USE IN NEW CODE """ import warnings warnings.warn("TrackDB.search is deprecated.", DeprecationWarning) tracks = [ x.track for x in search_tracks_from_string( self, query, case_sensitive=False, keyword_tags=['artist', 'albumartist', 'album', 'title']) ] if sort_fields: tracks = sort_tracks(sort_fields, tracks, reverse) if return_lim > 0: tracks = tracks[:return_lim] return tracks
def get_top_artists(field, limit): artists = [ x.artist for x in search.search_tracks_from_string( ex.exaile().collection, '! %s==__null__' % field) ] artists = util.sort_tracks([field], artists, True) return artists[:limit]
def get_top_albums(field, limit): albums = [ x.track for x in search.search_tracks_from_string( ex.exaile().collection, '! %s==__null__' % field) ] albums = util.sort_tracks([field], albums, True) return albums[:limit]
def search(self, query, sort_fields=[], return_lim=-1, tracks=None, reverse=False): """ DEPRECATED, DO NOT USE IN NEW CODE """ import warnings warnings.warn("TrackDB.search is deprecated.", DeprecationWarning) tracks = [ x.track for x in search_tracks_from_string(self, query, case_sensitive=False, keyword_tags=['artist', 'albumartist', 'album', 'title']) ] if sort_fields: tracks = sort_tracks(sort_fields, tracks, reverse) if return_lim > 0: tracks = tracks[:return_lim] return tracks
def get_top_artists(field, limit): artists = [x.artist for x in search.search_tracks_from_string( ex.exaile().collection, '! %s==__null__' % field)] artists = util.sort_tracks([field], artists, True) return artists[:limit]
def get_top_albums(field, limit): albums = [x.track for x in search.search_tracks_from_string( ex.exaile().collection, '! %s==__null__' % field)] albums = util.sort_tracks([field], albums, True) return albums[:limit]