Coder Social home page Coder Social logo

mopidy / mopidy-local Goto Github PK

View Code? Open in Web Editor NEW
60.0 15.0 25.0 175 KB

Mopidy extension for playing music from your local music archive

Home Page: https://mopidy.com/ext/local/

License: Apache License 2.0

Python 99.08% HTML 0.92%
python mopidy mopidy-backend

mopidy-local's Introduction

Mopidy-Local

Latest PyPI version CI build status Test coverage

Mopidy extension for playing music from your local music archive.

Table of contents

Maintainer wanted

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:

  1. Make 2-3 good pull requests improving any part of the project.

  2. Read and get familiar with all of the project's open issues.

  3. 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.

Installation

Install by running:

sudo python3 -m pip install Mopidy-Local

See https://mopidy.com/ext/local/ for alternative installation methods.

Configuration

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 to true.
  • 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 in local/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 of local/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 if local/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.

Usage

Generating a library

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:

  1. Ensure that the local/media_dir config value points to where your music is located. Check the current setting by running:

    mopidy config
    
  2. Scan your media library.:

    mopidy local scan
    
  3. Start Mopidy, find the music library in a client, and play some local music!

Updating the library

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

Clearing the library

To delete your local images and clear your local library:

mopidy local clear

A prompt will ask you to confirm this irreversible operation.

Library layout

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

URIs supported for browsing

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, and max-age.
  • local:directory?type=date: References to directories grouping tracks by date and album. Dates are transformed according to the optional parameter FORMAT which default to %Y-%m-%d. The URIs of the references start with local:directory?date=.
  • local:directory?type=genre: References to directories named after genres found among all tracks. Their URIs start with local: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 of albumartist, artist, composer, date, genre, performer, max-age. The referenced directories group the selected tracks by album; Their URIs start with local: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 URIs local:directory?ROLE=URI where URI varies among all URIs starting with local:artist build from all tracks tag corresponding to ROLE. ROLE is one of albumartist, artist, composer, or performer.
  • local:directory?album=URI: A reference to a directory grouping the tracks of the album with given URI. Its URI starts with local: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 with local: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 with local: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 with local: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 with local:directory?date=DATE&type=track&album=local:album:. The match is to be interpreted as in a LIKE 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 with local: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 with local: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 with local:directory?max-age=SECONDS&type=track&album=local:album:.

Project resources

Credits

mopidy-local's People

Contributors

delapouite avatar djmattyg007 avatar fatg3erman avatar jessesheidlower avatar jodal avatar kingosticks avatar lilyinstarlight avatar natumbri avatar orontee avatar schmaller avatar scuttlese avatar tkem avatar tomka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mopidy-local's Issues

Compiling for nanoPi M4 (AArch64) – How?

I'm trying to install mopidy-local on my FriendlyARM nanoPi M4 via python3 -m pip install mopidy-local but get the following compilation error. Any ideas how to fix this?

image

Same problem when compiling mopidy-headless:

image

Thanks in advance.

[Feature request] Opposite of excluded_file_extensions

My music collection has a lot of extra files cluttering it up, so it took me a while to build up the local/excluded_file_extensions option to skip all of them. I thought it would be more useful to have an included_file_extensions option, because a list of typical music file extensions is smaller. That could give you a bit of a problem if both options are used, but you could probably just deprecate and ignore excluded_file_extensions.

Local library - "resource not found" from scan.

I'm using Pi Musicbox, which is backed by Mopidy.
I've added a samba share to a USB drive plugged into my router, and can see all the music folders if I run "ls" from ssh.

When my Pi starts up, the scan kicks in (I can hear the drive chuntering away), but I never get anything in the musicbox library. Looking in the logfile, all my tracks are listed with an error of "resource not found", for example:

......
2015-02-11 22:30:01,222 - WARNING Failed local:track:Sigur%20R%C3%B3s/%28%20%29/03%20-%20Sigur%203%20%28Untitled%29.mp3: Resource not found.
2015-02-11 22:30:01,272 - WARNING Failed local:track:Sigur%20R%C3%B3s/%28%20%29/04%20-%20Sigur%204%20%28Untitled%29.mp3: Resource not found.
2015-02-11 22:30:01,314 - WARNING Failed local:track:Sigur%20R%C3%B3s/%28%20%29/05%20-%20Sigur%205%20%28Untitled%29.mp3: Resource not found.
2015-02-11 22:30:01,359 - WARNING Failed local:track:Sigur%20R%C3%B3s/%28%20%29/06%20-%20Sigur%206%20%28Untitled%29.mp3: Resource not found.
2015-02-11 22:30:01,410 - WARNING Failed local:track:Sigur%20R%C3%B3s/%28%20%29/07%20-%20Sigur%207%20%28Untitled%29.mp3: Resource not found.
2015-02-11 22:30:01,447 - WARNING Failed local:track:Sigur%20R%C3%B3s/%28%20%29/08%20-%20Sigur%208%20%28Untitled%29.mp3: Resource not found.
2015-02-11 22:30:01,522 - WARNING Failed local:track:Sigur%20R%C3%B3s/%C3%81g%C3%A6tis%20Byrjun/01%20Svefn-G-Englar%20%28Intro%29.mp3: Resource not found.
.......

Obviously the tracks themselves are being found otherwise the log would be empty... any ideas?

Add support for embedded album art in local / network files

I'm very new to mopidy (using via PiMusicbox right now), but while trying to build a small "now playing" frontend for low resolution LCD screens on the raspberry pi I noticed that mopidy doesn't seem to read album artwork that is embedded in local files.

PiMusicbox appears to rely on a request to a last.fm library to pull in the album artwork, but that could be avoided if the artwork is embedded in the file.

Would it be possible add support for reading embedded artwork from the ID3 tag and passing that in the album model as a data URI?

ignore folders

Sometimes it woudl be useful to exclude certain folders from scanning.

Take the following example:
Each CD I ripped is in an own subfolder. Most CDs are ripped twice, as FLAC and MP3. If I have both, I store the MP3-Files in a subfolder called "/mp3/" into the album directory. If i only have mp3, I don't use such a subfolder.
With these File structure, all CDs ripped twice are twice in the database. if i cloud exclude "/mp3"-subfolders, only the FLAC rip would be shown.
Even more sophisticated: something like .gitignore files for mopidy!?

Turn local scanning into a pipeline

Playing with some prototypes to speed up scanning I've come up with the following plan:

  • Switch to having a single actor look for files to scan
  • This actor feeds results onto a worker queue which will have 1-n scanners doing work
  • Scanners then place the results on a new queue which feeds into the library

Additionally this means we can stat files as we go instead of trying to everything up front and most likely still keep up with not blocking the scanners. My quick hack to add multiple scanners also showed that this will quickly move the bottleneck to the library indexing. At least this was the case with whoosh, while for the json backend there was no work to do so scanners could simple work at full speed.

Handle artist and album URIs in get_images()

Mopidy v1.0 Library.get_images() allows retrieving images for any URI, not just tracks. To facilitate this, a mapping of URIs to image paths should be kept, probably in an SQLite database.
Since the local scanner only provides a track URI in the model passed to local.Library.add(), the implementation needs too first call add() and then lookup on the delegate library to extract any album or artist URIs assigned by Mopidy-Local-SQLite, for example.

Build browse cache at scan time

Given the recent changes in the cache format we can now easily build it while scanning as we can add and remove things as we go. So the pre-built datastructure should be added to our json library file.

Auto-update local library while running

Logical step would be to start re-factoring the current scanner into an actor, then run the actor as a thread for the server case, and directly for the command case. This might entail using inotify if present, and falling back to mtime checks and just waiting a predefined time before the next check.

where is the SQLite database saved

Hi,

I am using docker and local database seems to be blown away each time I restart. Where is the database located so that I can map this to my host machine and not lose it.

Cheers

Convert to pathlib

To ensure proper handling of file systems with unknown encodings or even arbitrary bytes in the file names, we should fully convert Mopidy-Local to use pathlib instead of os.path.

local scan: report progress

I'm playing with mopidy local scan and an initial observation is I can't pull progress info out of mopidy any way. Not even with logging set to the DEBUG level.

Given a local media store can be large and take a long time to scan, I see it as imperative to see some pulse of life, or progress report from the scanner. Not least when any number of things might cause it to hang, not least of which being the local media store being on a mounted NAS system (hardly an unusual scenario I'd think) - though that is stretching the definition of "local" it is none the less where local media library might (in my case, does) reside.

Maintain DB Integrity During Local Scan

Currently, unreferenced albums and artists are deleted in SQLiteLibrary.close(), so these may still show up after an SQLiteLibrary.flush(). Therefore, cleanup code should be moved to triggers.

UTF-8 error with local extension

Systemdetails ->
-> Filesystem NTFS automounted with systemd
-> system locale = de_DE.UTF-8

[local]
#library = sqlite
data_dir = /var/lib/mopidy/local
media_dir = /var/lib/mopidy/media
scan_follow_symlinks = true

All directories which should be included are symlinked into /var/lib/mopidy/media

If i start mopidy local scan i get the following error since upgrading to mopidy local for version 3 of mopidy ->

2020-01-10 13:48:03,380 ERROR [47356:MainThread] mopidy.main: 'utf-8' codec can't encode character '\udc83' in position 43: surrogates not allowed
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/mopidy/main.py", line 143, in main
return args.command.run(args, proxied_config)
File "/usr/lib/python3.8/site-packages/mopidy_local/commands.py", line 111, in run
uri = translator.path_to_local_track_uri(relpath)
File "/usr/lib/python3.8/site-packages/mopidy_local/translator.py", line 33, in path_to_local_track_uri
relpath = relpath.encode()
UnicodeEncodeError: 'utf-8' codec can't encode character '\udc83' in position 43: surrogates not allowed

Support Multiple Artists/Composers/Performers

As stated in the README.rst, the current DB schema does not support multiple artists, composers, or performers.

(Non-functional) Requirements:

  • At least for the common, single-artist case, there should be no noticable performance impact (especially on small platforms like the Raspberry Pi).
  • The one result row per track property of the tracks view should be maintained.
  • Denormalization of the schema in general should be avoided, if feasible.
  • Storing data as text ist preferred.
  • An upgrade path for existing users must be provided.

'mopidy local scan' is using the wrong config file

I run mopidy as a service, so my config is located in /etc/mopidy/mopidy.conf.

However, mopidy local scan is reading config from the /home/pi/.config/mopidy/mopidy.conf file.

mopidy local scan should be using the actual config loaded into mopidy instead.

Artist sort order

not entirely sure that this is a mopidy-local issue so let me know if I got the wrong project!

When viewing tracks by artist, I would expect the sort order to be based on the "Album Artist Sort Order" or "Artist Sort Order" tag rather than strict alphabetical. So for example, artist "The August List" would come under "A" for "August List, The" rather than under "T" for "The" which it does at present.

Of course it is possible I just have some config set wrong. Apologies if that is the case.

Prompt for confirmation when local library is empty

Hi,
Running into some undesired behavior and could use some help. I have a large library mounted via SMB to my RPi. If initialize a local scan and the network drive for whatever reason is accidentally not mounted, my entire library is instantly deleted.

I understand why this behaves this way, but if the library is changing by a large amount of tracks (in my case 7k to 0), it would be nice if if prompted before continuing as it then takes over 3 hours to entirely rebuild the library. Is there any way to have local scan either prompt me before clearing the library for "not found" tracks or work around this issue?

Thanks!

Browsing directories by type 'date' returns incorrect names when format is not YYYY-MM-DD

As reported in mopidy/mopidy-mpd#31, when browsing by 'Release Years' (or any local:directory query with type=date), tracks with their date tag not in the format YYYY-MM-DD are not displayed correctly.

  • Legitimate dates in format YYYY are returned with name '-470'
  • Any non-null values that cannot be converted by strftime are returned without a name

One way to fix this would be to only insert valid YYYY-MM-DD format SQLite time strings when adding tracks to the database. Then strftime can always handle the value.

Add "Album Artists" to root directories

It's already supported in v0.8.0, just needs to be included in the default configuration:

directories =
    Albums              local:directory?type=album
    Album Artists       local:directory?type=artist&role=albumartist
    Artists             local:directory?type=artist
[...]

Some people may prefer it to the way "Artists" are handled, and it might help with support issues, e.g. "artist" tags vs. "albumartist" tags. Note that MPDroid also has a "Use album artists" setting for its local browse configuration.

Folder directory

Hello,

I use mopidy-local together with mopidy-iris.
Everything works very well but I am missing something I thougth it was there.

A "Folder" directory to browse the folder structure.
Is there a possibility to get it?

grafik

Not load from global config file

I use /etc/mopidy/mopidy.conf, add these lines:

[local]
enabled = true
media_dir = var/lib/mopidy/xxx

and use mopidy local scan got

ERROR    2021-07-28 10:51:22,356 [900843:MainThread] mopidy.__main__
  Unable to run command provided by disabled extension local

and mopidy config got

[local]
enabled = false  ; Extension disabled due to config errors.
max_search_results = 100
media_dir =  ; Must be set.

after add to ~/.config/mopidy/mopidy.config and run mopidy local scan without errors

Doesn't Add any Music to Library

Not sure what the exact bug that is causing this is, but I can't get mopidy to add any of my music files to the library. I am running on a raspberry pi with the music being hosted on NFS that is mounted to raspberry pi in fstab. I can go into mopidy iris webui and see the music files when browsing "files" (/var/lib/mopidy/media"). However, when scanning for local media, it takes about an hour to scan the media directory (which only contains a few albums to begin with, so very poor performance) and then when its finished, it doesnt even add anything to the library.

It is a brand new, fresh and extremely minimal setup, so I am not sure how no one else is having this issue. Config file:

[core]
data_dir = /var/lib/mopidy

[audio]
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo

[local]
media_dir = /var/lib/mopidy/media

[http]
hostname = 0.0.0.0
default_app = iris

[mpd]
hostname = 0.0.0.0

I do see this error in the logs:

Error browsing local:directory?type=album: no such table: album
ERROR 2020-10-24 23:57:25,928 [6:LocalBackend-7] mopidy_local.library

Not sure why its not just creating the library table if thats all the issue is.
And also this error:

Lookup error for local:directory: Invalid lookup URI
ERROR 2020-10-25 00:11:45,650 [6:LocalBackend-7] mopidy_local.library

Once again, a fresh install, so I am not sure why all of these things are so misconfigured out of box

Wishlist: Command to update local tag cache

Now that mopidy_scan is no more and that functionality is integrated into mopidy, would it be possible to implement mpd's 'update' command to permit the local files cache to be updated by a client. Many people are running mopidy on headless servers with remote clients, and running 'mopidy local scan' from a client isn't elegant or even possible sometimes.

The mopidy.library.refresh() API command would seem to be the obvious place to add this.

Prefer embed album art to folder album art

AKA: If the track does have an album art, grab that instead of the folder album art.

This is because there may be random images in the tracks' folder, such as booklet scans.
Also, this would fix a current issue where some singles don't have any art displayed even if they have their own embedded in their tags. That's because some media players create an "AlbumArt.jpg" / "Folder.jpg" on folders full of singles; then Mopidy-Local scans the folder and doesn't know what to do precisely (and I personally noticed this behaviour, I don't even know if it's somewhat intended at this point).
This issue could be worked around by creating a subfolder per file, but that process is tedious and problematic for huge music collections.

Stop using deprecated methods

The extension's test suite currently triggers 440 warnings, mostly because it uses a few deprecated Mopidy APIs a lot.

Runs out of memory while doing local scan of big library on Raspberry PI Zero W

Last output:

INFO     Scanned 18700 of 26522 files in 12201s, ~5103s left.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/DIRECTSO.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/FILEIO.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/FLASHASS.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/FONTASSE.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/FONTXTRA.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/INETURL.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/MACROMIX.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/MIXSERVI.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/MPEG3IMP.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/MUIDIALO.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/NETFILE.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/NETLINGO.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/QT3ASSET.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/SOUNDCON.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/SOUNDIMP.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/SWACMPR.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/SWACNVRT.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/SWADCMPR.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/SWAIMPOR.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/SWAOPT.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/SWASTRM.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/TEXTASSE.X32: No audio found in file.
WARNING  Failed local:track:Ozzy%20Osbourne/2001%20-%20Down%20To%20Earth/DATA/XTRAS/TEXTXTRA.X32: No audio found in file.
INFO     Scanned 18800 of 26522 files in 12234s, ~5025s left.

(python:2337): GLib-ERROR **: /build/glib2.0-F5w919/glib2.0-2.50.3/./glib/gmem.c:100: failed to allocate 11017050 bytes
Trace/breakpoint trap

By the way, log file didn't catch that for some reason. Last line in log file is last progress report on scanning.

I'm running:

pi@mopidy-zero:/var/log/mopidy $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.1 (stretch)
Release:        9.1
Codename:       stretch
pi@mopidy-zero:/var/log/mopidy $ uname -a
Linux mopidy-zero 4.9.59+ mopidy/mopidy#1047 Sun Oct 29 11:47:10 GMT 2017 armv6l GNU/Linux

pi@mopidy-zero:/var/log/mopidy $ dpkg -s mopidy
Package: mopidy
Status: install ok installed
Priority: optional
Section: sound
Installed-Size: 853
Maintainer: Stein Magnus Jodal <[email protected]>
Architecture: all
Version: 2.1.0-1

get_distinct does not support field 'track'

The current implementation of get_distinct handles field value 'track_name' rather than 'track', the latter of which is what Mopidy 3.x and below use.

mopidy/mopidy#1900 aims to fix this so that 'track_name' will be used, but until that breaking API change is released (next major version?), 'track' will continue to be used and Mopidy-Local needs to support this. When testing Mopidy-Local with mopidy/mopidy#1900, sending mpc list title produces the following error:

Core-7 ERROR    2020-05-17 15:48:36,363 LocalBackend backend caused an exception.
Traceback (most recent call last):
  File "/home/nick/Dev/mopidy-dev/mopidy/mopidy/core/library.py", line 17, in _backend_error_handling
    yield
  File "/home/nick/Dev/mopidy-dev/mopidy/mopidy/core/library.py", line 155, in get_distinct
    values = future.get()
  File "/usr/lib/python3/dist-packages/pykka/_threading.py", line 45, in get
    _compat.reraise(*self._data['exc_info'])
  File "/usr/lib/python3/dist-packages/pykka/_compat/__init__.py", line 29, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/pykka/_actor.py", line 193, in _actor_loop
    response = self._handle_receive(envelope.message)
  File "/usr/lib/python3/dist-packages/pykka/_actor.py", line 299, in _handle_receive
    return callee(*message.args, **message.kwargs)
  File "/home/nick/Dev/mopidy-dev/mopidy-local/mopidy_local/library.py", line 105, in get_distinct
    return set(schema.list_distinct(self._connect(), field, q))
  File "/home/nick/Dev/mopidy-dev/mopidy-local/mopidy_local/schema.py", line 204, in list_distinct
    raise LookupError("Invalid search field: %s" % field)
LookupError: Invalid search field: track

Put back the use_album_mbid_uri option that was in local-sqlite

Using MBIDs to create uris can have unintended consequences. With local-sqlite I could switch this off but this option seems to have been removed in the new mopidy-local.

As an example, I have 2 albums that I tagged with Musicbrainz Picard.

One has 'Artist = Brian Eno'
One has 'Artist = Brian Eno & Jah Wobble'

They're also tagged with musicbrainz IDs for the artists. The second album has two artist ID tags even though it only has one artist. (This is the way Musicbrainz reccomend it is done). Since the scanner can only use one mbid to create the artist URI, both albums end up under 'Brian Eno and Jah Wobble'.

With the old local-sqlite setting use_album_mbid_uri = false in mopidy.conf fixed this.

Limit of searchresults are hardcoded

I don't know why, but for some reason the results of search against the local backend are hardcoded to return only 100 results. This has to be a bug or some kind of oversight.

The number of returned searchresult should be a number configurable in the config-file, or a parameter when doing the api.call.

Concept of 'local/directories'?

Would someone be so kind to explain the concept of the above named config setting?
I don't get what this setting does, why it is needed and how it is used...

Not extracting images from m4a files when scanning

Whenever I execute mopidy local scan --force in my terminal, I get an error extracting the image from any m4a file.

Example: WARNING 2021-02-20 22:42:52,743 [111960:MainThread] mopidy_local.storage Error extracting images for 'local:track:MDMA/Genie%20%28Deluxe%29/01%20Xccelerate.m4a': ValueError('Unknown image type')

I can play these files completely fine with ncmpcpp's file browser and they are tagged properly too but I can't scan them into my library.

A proper home for `find_mtimes()`

[Moved from PR comment in #10.]

In Mopidy, mopidy.internal.path.find_times() is now a reexport of mopidy.internal.mtimes.find_times(). It is only used by tests/audio/test_scan.py. I think that we should either:

  • conclude that the mopidy.internal.mtimes module belongs in Mopidy-Local and not Mopidy, or
  • make find_times() a public method, maybe in the mopidy.audio.scan module?

@adamcik Any thoughts on the placement of the scanner and its supporting functions?

TypeError: '<' not supported between instances of 'NoneType' and 'int'

ERROR    [MainThread] mopidy.__main__ '<' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mopidy/__main__.py", line 143, in main
    return args.command.run(args, proxied_config)
  File "/usr/local/lib/python3.7/dist-packages/mopidy_local/commands.py", line 102, in run
    limit=args.limit,
  File "/usr/local/lib/python3.7/dist-packages/mopidy_local/commands.py", line 224, in _scan_metadata
    elif result.duration < MIN_DURATION_MS:
TypeError: '<' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
  File "/usr/bin/mopidy", line 11, in <module>
    load_entry_point('Mopidy==3.0.1', 'console_scripts', 'mopidy')()
  File "/usr/lib/python3/dist-packages/mopidy/__main__.py", line 143, in main
    return args.command.run(args, proxied_config)
  File "/usr/local/lib/python3.7/dist-packages/mopidy_local/commands.py", line 102, in run
    limit=args.limit,
  File "/usr/local/lib/python3.7/dist-packages/mopidy_local/commands.py", line 224, in _scan_metadata
    elif result.duration < MIN_DURATION_MS:
TypeError: '<' not supported between instances of 'NoneType' and 'int'
# python3 -m pip list | grep Local
Mopidy-Local              3.1.0         

Multiple filtering criteria when browsing

When browsing any local media category (Artist, Genre, Composer, etc.) that returns a list of albums, it would be nice if it also listed all other unused categories with the albums, before the first album, so as to be able filter the list of albums by multiple criteria.

Say, being able to browse Genre ▸ Classical ▸ Composer ▸ Beethoven would list all albums that are classical music composed by Beethoven. I consider this essential for classical music.

Apple TV has allowed this since forever when browsing a LAN-shared iTunes library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.