Skip to content

Bug Fix: Music library is emptied at Lollypop start time when the library path is a symlink

When the Music library is a symlink to another out-of-tree directory (for instance, $HOME/Music -> /data/music), Lollypop will remove all files from the library every other start, then will re-add everything on the subsequent one, and so on.

The root cause is that the file tree traversal (correctly) generates dereferenced path, which are then stored in db (for instance, file:///data/music/XXX). However, the __remove_old_tracks method will try to match them with an existing collection (for instance, file:///$HOME/Music) and will fail with a "Removed, not in collection anymore" warning.

This pull request fixes this issue by making __remove_old_tracks reuse the results of the previous call to __scan_files, and remove any file referenced in the db but not found during the scan, therefore addressing both use cases of deleted files, and of collection path changes.

Merge request reports