calliope.localsearch¶
Export data from the LocalSearch desktop search engine, formerly known as Tracker.
See also: cpe localsearch command.
Attributes¶
Classes¶
Interface for modules that can resolve playable tracks. |
|
Helper functions for querying from the user's LocalSearch database. |
Functions¶
|
Resolve images from local media-art cache. |
|
Resolve content locations from the local filesystem. |
|
Resolve |
|
Expand an |
Package Contents¶
- class calliope.localsearch.ContentResolver¶
Interface for modules that can resolve playable tracks.
- abstractmethod authenticate()¶
- abstractmethod resolve_content(playlist)¶
- Parameters:
playlist (calliope.playlist.Playlist)
- Return type:
- calliope.localsearch.LOCALSEARCH_INDEXER = 'org.freedesktop.LocalSearch3'¶
- class calliope.localsearch.LocalSearchClient(http_endpoint=None)¶
Bases:
calliope.interface.ContentResolverHelper functions for querying from the user’s LocalSearch database.
This class caches a LocalSearchSparqlConnection and prepared SPARQL statements. For that reason it should only be used from a single thread. Create multiple instances if you need to use this from multiple threads.
- QUERIES_PATH¶
- MAX_ROW_COUNT = 9223372036854775808¶
- authenticate()¶
No-op as this is a local service.
- query(query)¶
Run a single SPARQL query.
- Parameters:
query (str)
- Return type:
gi.repository.Tsparql.SparqlCursor
- artist_id(artist_name)¶
Return the LocalSearch URN for a given artist.
- Parameters:
artist_name (str)
- Return type:
str
- artist_name(artist_id)¶
Return the name of a given artist.
- Parameters:
artist_id (str)
- Return type:
str
- artists_by_number_of_songs(limit=None)¶
Return a list of artists by number of songs known.
- Parameters:
limit (int)
- albums(filter_artist_name=None, filter_album_name=None)¶
Return a list of releases.
- Parameters:
filter_artist_name (str)
filter_album_name (str)
- track(artist_name, track_name)¶
Find a specific track by name.
Tries to find a track matching the given artist and title.
Returns a playlist entry, or None.
- Parameters:
artist_name (str)
track_name (str)
- Return type:
calliope.playlist.Item
- tracks(filter_artist_name=None, filter_album_name=None)¶
Return a list of tracks.
- Parameters:
filter_artist_name (str)
filter_album_name (str)
- Return type:
- tracks_grouped_by_album(filter_artist_name=None, filter_album_name=None, filter_track_name=None)¶
Return all songs matching specific search criteria.
These are grouped into their respective releases. Any tracks that aren’t present on any releases will appear last. Any tracks that appear on multiple releases will appear multiple times.
- Parameters:
filter_artist_name (str)
filter_album_name (str)
filter_track_name (str)
- Return type:
- artists()¶
Return all artists who have at least one track available locally.
- Return type:
- search(search_text)¶
Return a list of tracks which match ‘search_text’.
The text may be matched in the artist name, track title or album name.
- Parameters:
search_text (str)
- Return type:
- resolve_content(playlist)¶
Resolve content locations from the local filesystem.
- Parameters:
playlist (calliope.playlist.Playlist)
- Return type:
- calliope.localsearch.annotate_images(localsearch, playlist)¶
Resolve images from local media-art cache.
- Parameters:
localsearch (LocalSearchClient)
playlist (calliope.playlist.Playlist)
- Return type:
- calliope.localsearch.resolve_content(localsearch, playlist, *args, **kwargs)¶
Resolve content locations from the local filesystem.
- Parameters:
localsearch (LocalSearchClient)
- Return type:
- calliope.localsearch.resolve_image(localsearch, playlist)¶
Resolve
imagefrom local media-art cache.- Parameters:
localsearch (LocalSearchClient)
playlist (calliope.playlist.Playlist)
- Return type:
- calliope.localsearch.expand_tracks(localsearch, playlist)¶
Expand an
albumitem into a list of the album’s tracks.- Parameters:
localsearch (LocalSearchClient)
playlist (calliope.playlist.Playlist)
- Return type: