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 Library.browse() method.
Add the given track to library.
Parameters: | track (Track) – Track to add to the library |
---|
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.
Return type: | Track iterator |
---|
Browse directories and tracks at the given URI.
The URI for the root directory is a constant available at Library.ROOT_DIRECTORY_URI.
Parameters: | path (string) – URI to browse. |
---|---|
Return type: | List of Ref tracks and directories. |
Clear out whatever data storage is used by this backend.
Return type: | Boolean indicating if state was cleared. |
---|
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.
Return type: | int representing 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: | Track |
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 the library for tracks where field contains values.
Parameters: |
|
---|---|
Return type: |