3

The GNOME "Music" app says it searches my Music folder (e.g. it says this in the message you see when the directory is empty).

However it does not follow symbolic links inside ~/Music/ to other directories.

I already have a hierachy of music files. I can't sym-link ~/Music to the root of my hierarchy, because that includes duplicates (different codecs). Nor can I point it at a single sub-directory that contains all the files I want, without using symlinks.

Is there a way to support the existing hierarchy, that doesn't involve writing a script to copy gigabytes of music files?

gnome-music-3.24.2-1.fc26.x86_64

2 Answers 2

5

GNOME Music does not index the ~/Music directory directly.

It uses the shared GNOME indexer, which is called tracker. GNOME lets you configure this in Settings -> Search -> Files. (Select Files and click the cog icon). The dialog shows your Places (xdg dirs like ~/Music), Bookmarks, and Other. You can disable searching in individual Places, enable searching any of your bookmarked folders, and/or manually add folders in the Other section.

This allows you to add an arbitrary set of folders to be indexed for music. Assuming you don't also need it to be a different set of folders than what the file search will index.

tracker status and tracker info can be used to check the current status of the index.

tracker appears happy to index files outside your home directory, but GNOME Music does not seem to pick them up. That can be defeated by adding symlinks from your home directory.

It looks like album art is cached in some weird fashion. If Music has seen an album before, it may remember the album cover, even if the files you added this time don't include any album art. ("There are only two hard things in Computer Science...")

GNOME Music can also overlook an album in some circumstances, so you may have to remove ~/.local/share/gnome-music to force Music to rescan.

If you have to change permissions on some music files to allow your user to read them, tracker will not rescan them immediately. tracker index --file ~/Music does not seem reliable in this situation either, but to trigger a rescan you can just move those files in and out of a temporary directory. Thankfully, tracker seems able to process files in a reasonable amount of time.

2

tracker does not rescan files when it is newly granted permission to access them. tracker index --file ~/Music does not seem reliable in this situation either

actually as stated at https://wiki.gnome.org/Apps/Music/Resources#Available_content is possible to change and re-index the Music collection

xdg-user-dirs-update --set MUSIC /path/to/music/collection
tracker index -f /path/to/music/collection

I've used these commands to properly index my iTunes folders:

xdg-user-dirs-update --set MUSIC $HOME/Music/iTunes/iTunes\ Media/Music
tracker index -f $HOME/Music/iTunes/iTunes\ Media/Music

Obviously tracker takes long time to index large collections. You could watch the work being done using:

tracker daemon -w

And test it after some time:

tracker search --music-albums
5
  • I summarized my experience including using tracker index --file ~/Music, and I trust my past self - on his report about the environment he tested in :-). It might have been an issue with a specific version of tracker; I didn't include a version number for it.
    – sourcejedi
    Commented Apr 12, 2020 at 17:03
  • This specific question was about the case where I have several separate folders to index. Setting the XDG MUSIC directory was not an answer, because the shared ancestor of the separate folders also included content I did not want indexed (duplicates). (And I tried setting the XDG MUSIC directory to a directory which included symbolic links to the desired folders, and that did not index them for me either).
    – sourcejedi
    Commented Apr 12, 2020 at 17:12
  • The quote you picked up on is another specific issue. I have edited my wording, to be a bit clearer about what that case was.
    – sourcejedi
    Commented Apr 12, 2020 at 17:15
  • My question title was not very clear either :-). (If you think of a title I like better, and use the edit link to suggest it, you can increase the number next to your name by 2. If that is something you are interested in :-).
    – sourcejedi
    Commented Apr 12, 2020 at 18:09
  • I got it! You're right my answer is more about another topic: how to instruct tracker to index subfolders of Music when its subfolders are not artist/album/song.mp3 themselves. In my case, iTunes folder structure has that many subfolders until reach the artist/album folders. This was the root cause of my need to change xdg-user-dirs-update, actually. Thank you! Commented Apr 13, 2020 at 23:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .