mopidy.local – Local backend¶
For details on how to use Mopidy’s local backend, see Mopidy-Local.
Local library interface.
Extensions that wish to provide an alternate local library storage backend need to sub-class this class and install and configure it with an extension. Both scanning and library calls will use the active local library.
Parameters: config – Config dictionary
URI of the local backend’s root directory.
This constant should be used by libraries implementing the
Prepare library for accepting updates. Exactly what this means is highly implementation depended. This must however return an iterator that generates all tracks in the library for efficient scanning.
Browse directories and tracks at the given URI.
The URI for the root directory is a constant available at
Parameters: path (string) – URI to browse. Return type: List of
Reftracks and directories.
Clear out whatever data storage is used by this backend.
Return type: Boolean indicating if state was cleared.
Close any resources used for updating, commit outstanding work etc.
Called for every n-th track indicating that work should be committed. Sub-classes are free to ignore these hints.
Return type: Boolean indicating if state was flushed.
(Re)load any tracks stored in memory, if any, otherwise just return number of available tracks currently available. Will be called at startup for both library and update use cases, so if you plan to store tracks in memory this is when the should be (re)loaded.
intrepresenting number of tracks in library.
Lookup the given URI.
Unlike the core APIs, local tracks uris can only be resolved to a single track.
Parameters: uri (string) – track URI Return type:
Name of the local library implementation, must be overriden.
Remove the given track from the library.
Parameters: uri (str) – URI to remove from the library/
search(query=None, limit=100, offset=0, exact=False, uris=None)¶
Search the library for tracks where
Parameters: Return type: