mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.35k stars 1.25k forks source link

relinking library directory should automatically rescan library #12858

Open Be-ing opened 6 months ago

Be-ing commented 6 months ago

Bug Description

Relinking a library directory in the Library preferences requires manually rescanning the library for Mixxx to find the files. This should be done automatically when saving the changed preferences.

Version

2.4.0

OS

Fedora 39

manuelbertelli commented 6 months ago

How do I assign this issue to me?

Be-ing commented 6 months ago

There's no need to assign the issue, you can just go ahead and open a pull request when you have a fix implemented. Please include Fixes https://github.com/mixxxdj/mixxx/issues/12858 in your commit message so this issue gets closed automatically when the PR is merged.

manuelbertelli commented 6 months ago

Relinking = relocate dir?

Be-ing commented 6 months ago

Yes, using the Relink button in the Library preferences.

ronso0 commented 6 months ago

Why is a rescan required?

IIUC, if the (inner) directory structure didn't change (dirs or tracks renamed / deleted) all tracks should be updated correctly. or are you referring to the relink after migrating the Mixxx db to another OS / computer / ...? In that case encoders (availability / version) might have changed and rescan might be needed.

ronso0 commented 6 months ago

Note: relinking was actually broken before #12462 (dirs were update but not the tracks).

Be-ing commented 6 months ago

are you referring to the relink after migrating the Mixxx db to another OS / computer / ...?

I noticed this issue when testing migration into the Flatpak sandbox https://mixxx.org/news/2024-02-21-official-flatpak-now-available-on-flathub/

ronso0 commented 6 months ago

I saw that, but does that mean we need a full rescan in order to get access to each track?

ronso0 commented 6 months ago

Okay, I tried this myself:

Conclusion:

The rescan is not required in general. Relink is sufficient. I did this test on Ubuntu 20.04.05. If this works differently on other OS, okay, but I don't agree we should demand the rescan until we figured when/why it is necessary.

Be-ing commented 6 months ago

flatpak override org.mixxx.Mixxx --filesystem=~/someMusicDir

That will change the result. That shouldn't be required.

ronso0 commented 6 months ago

The only useful dir permissions Mixxx has after installation are for /media and xdg-music. My main music directory is on another drive mounted in /mnt, and one in /home. In the Relink file picker there is no way to see other directories, let alone grant access. Neither https://flathub.org/apps/org.mixxx.Mixxx nor https://github.com/flathub/org.mixxx.Mixxx give any hints how to deal with this.

The Flatpak sandbox docs advice to use flatpak override [app-id] --filesystem=~/file/path. As I wrote above, I also used Flatseal to grant access to another directory: no relink required, no issues. (FWIW Flatseal did not list the dir I added previously with flatpak override org.mixxx.Mixxx --filesystem=) When I test with a music dir in /media: no relink required, no issues.

This is with flatpak-1.6.5-0ubuntu.4 xdg-desktop-portal-1.6.1-1ubuntu2

Be-ing commented 6 months ago

In the Relink file picker there is no way to see other directories

Really? The file picker dialog goes through the XDG File Chooser portal, so it should let you choose any directory that your user has permission to, including outside the Flatpak sandbox.

Be-ing commented 6 months ago

The only useful dir permissions Mixxx has after installation are for /media and xdg-music.

Right, relinking is only needed if the user already had directories outside of these paths in their Mixxx database.

ronso0 commented 6 months ago

In the Relink file picker there is no way to see other directories

Really? The file picker dialog goes through the XDG File Chooser portal, so it should let you choose any directory that your user has permission to, including outside the Flatpak sandbox.

What shall I say, xdg-desktop-portal is 1.6.1-1ubuntu2 which is quite old I guess. Anyhow, please simulate the migration yourself again and verify a rescan is indeed still required.