Mopidy extension for playing music from your local music archive.
Mopidy-Local is currently kept on life support by the Mopidy core developers. It is in need of a more dedicated maintainer.
If you want to be the maintainer of Mopidy-Local, please:
Make 2-3 good pull requests improving any part of the project.
Read and get familiar with all of the project's open issues.
Send a pull request removing this section and adding yourself as the "Current maintainer" in the "Credits" section below. In the pull request description, please refer to the previous pull requests and state that you've familiarized yourself with the open issues.
As a maintainer, you'll be given push access to the repo and the authority to make releases to PyPI when you see fit.
Install by running:
sudo python3 -m pip install Mopidy-Local
See https://mopidy.com/ext/local/ for alternative installation methods.
Before starting Mopidy, you must add configuration for Mopidy-Local to your Mopidy configuration file:
[local] media_dir = /path/to/your/music/archive
The following configuration values are available:
local/enabled
: If the local extension should be enabled or not. Defaults totrue
.local/media_dir
: Path to directory with local media files.local/max_search_results
: Number of search results that should be returned. Default is 100.local/scan_timeout
: Number of milliseconds before giving up scanning a file and moving on to the next file.local/scan_follow_symlinks
: If we should follow symlinks found inlocal/media_dir
.local/scan_flush_threshold
: Number of tracks to wait before telling library it should try and store its progress so far. Some libraries might not respect this setting. Set this to zero to disable flushing.local/included_file_extensions
: File extensions to include when scanning the media directory. Values should be separated by either comma or newline. Each file extension should start with a dot, .e.g..flac
. Setting any values here will override the existence oflocal/excluded_file_extensions
.local/excluded_file_extensions
: File extensions to exclude when scanning the media directory. Values should be separated by either comma or newline. Each file extension should start with a dot, .e.g..html
. Defaults to a list of common non-audio file extensions often found in music collections. This config value has no effect iflocal/included_file_extensions
is set.local/directories
: List of top-level directory names and URIs for browsing. See below.local/timeout
: Database connection timeout in seconds.local/use_artist_sortname
: Whether to use the sortname field for ordering artist browse results. Disabled by default, since this may give confusing results if not all artists in the library have proper sortnames.local/album_art_files
: List of file names to check for when searching for external album art. These may contain UNIX shell patterns, i.e.*
,?
, etc.
The command mopidy local scan
will scan the path set in the
local/media_dir
config value for any audio files and build a
library of metadata.
To make a local library for your music available for Mopidy:
Ensure that the
local/media_dir
config value points to where your music is located. Check the current setting by running:mopidy config
Scan your media library.:
mopidy local scan
Start Mopidy, find the music library in a client, and play some local music!
When you've added or removed music in your collection and want to update Mopidy's index of your local library, you need to rescan:
mopidy local scan
Options can be specified to control the behavior of the scan command:
--force
Force rescan of all media files--limit <number>
Maximum number of tracks to scan
Example:
mopidy local scan --limit 50
To delete your local images and clear your local library:
mopidy local clear
A prompt will ask you to confirm this irreversible operation.
The exposed library has a root directory and nine top-level directories defined under the root directory:
- Albums
- Artists
- Composers
- Genres
- Performers
- Release Years
- Tracks
- Last Week's Updates
- Last Month's Updates
This can be configured through the directories
setting. It's expected to be a
list of space separated name and URI supported for browsing, eg:
directories = Albums local:directory?type=album Artists local:directory?type=artist Composers local:directory?type=artist&role=composer Tracks local:directory?type=track Last Week's Updates local:directory?max-age=604800
Remember that URIs are opaque values that neither Mopidy’s core layer or Mopidy
frontends should attempt to derive any meaning from. That said, it's necessary
to have a sufficient knowledge of Mopidy-Local URIs to customize the
directories
setting properly.
Browsing URIs starting with local:artist
returns references to
albums and tracks with the given artist. Browsing URIs starting with
local:album
returns references to the album tracks. Browsing URIs
starting with local:track
is not supported.
Other URIs supported for browsing start with local:directory
. The returned
references are specified through "query parameters":
local:directory
: References to the top levels directories.local:directory?type=tracks
: References all tracks. Multiple parameters can be added to filter the referenced tracks:album
,albumartist
,artist
,composer
,date
,genre
,performer
, andmax-age
.local:directory?type=date
: References to directories grouping tracks by date and album. Dates are transformed according to the optional parameterFORMAT
which default to%Y-%m-%d
. The URIs of the references start withlocal:directory?date=
.local:directory?type=genre
: References to directories named after genres found among all tracks. Their URIs start withlocal:directory?genre=
.local:directory?type=album
: References to all albums.local:directory?type=album&PARAM=VALUE
: References to directories grouping tracks matching the given criteria.PARAM
must be one ofalbumartist
,artist
,composer
,date
,genre
,performer
,max-age
. The referenced directories group the selected tracks by album; Their URIs start withlocal:directory?PARAM=VALUE&type=track&album=local:album:
.local:directory?type=artist
: References to all artists.local:directory?type=artist&role=ROLE
: References to directories with URIslocal:directory?ROLE=URI
whereURI
varies among all URIs starting withlocal:artist
build from all tracks tag corresponding toROLE
.ROLE
is one ofalbumartist
,artist
,composer
, orperformer
.local:directory?album=URI
: A reference to a directory grouping the tracks of the album with given URI. Its URI starts withlocal:directory?album=URI&type=track
.local:directory?albumartist=URI
: References to directories grouping tracks whose albumartist tag has given URI. The referenced directories group the selected tracks by album; Their URIs start withlocal:directory?albumartist=URI&type=track&album=local:album:
.local:directory?artist=URI
: References to directories grouping tracks whose artist has given URI. The referenced directories group the selected tracks by album; Their URIs start withlocal:directory?artist=URI&type=track&album=local:album:
.local:directory?composer=URI
: References to directories grouping tracks whose composer has given URI. The referenced directories group the selected tracks by album; Their URIs start withlocal:directory?composer=URI&type=track&album=local:album:
.local:directory?date=DATE
: References to directories grouping tracks whose date match DATE. The referenced directories group the selected tracks by album; Their URIs start withlocal:directory?date=DATE&type=track&album=local:album:
. The match is to be interpreted as in aLIKE
SQL statement.local:directory?genre=GENRE
: References to directories grouping tracks whose genre is GENRE. The referenced directories group the selected tracks by album; Their URIs start withlocal:directory?genre=GENRE&type=track&album=local:album:
.local:directory?performer=URI
: References to directories grouping tracks whose performer has given URI. The referenced directories group the selected tracks by album; Their URIs start withlocal:directory?performer=URI&type=track&album=local:album:
.local:directory?max-age=SECONDS
: References to directories grouping tracks whose "last modified" date is newer than SECONDS seconds. The referenced directories group the selected tracks by album; Their URIs start withlocal:directory?max-age=SECONDS&type=track&album=local:album:
.
- Original authors: Stein Magnus Jodal and Thomas Adamcik for the Mopidy-Local extension in Mopidy core. Thomas Kemmer for the SQLite storage and support for embedded album art.
- Current maintainer: None. Maintainer wanted, see section above.
- Contributors