Bug 410670 - Baloo indexer doesn't follow symlinks
Summary: Baloo indexer doesn't follow symlinks
Status: RESOLVED FIXED
Alias: None
Product: Elisa
Classification: Applications
Component: baloo (show other bugs)
Version: 0.4.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Matthieu Gallien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-06 20:21 UTC by Luca Weiss
Modified: 2019-08-22 18:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Weiss 2019-08-06 20:21:45 UTC
Originally raised by me in https://bugs.kde.org/show_bug.cgi?id=407918#c12 but that was a different issue.

SUMMARY
When ~/Music is a symlink to somewhere else, no music is found by elisa because of that:

org.kde.elisa.baloo: rootPaths: ("/home/luca/Music")
org.kde.elisa.baloo: LocalBalooFileListing::triggerRefreshOfContent "/mnt/hdd/Music/Monstercat/Monstercat 020 - Altitude/16. Muzzy - Lost Metropolis.mp3" does not match root paths

So basically the symlink has to be resolved. After changing the Elisa config to not point to /home/luca/Music but to /mnt/hdd/Music, my music finally appeared.

(for debugging baloo stuff in elisa, the command 'env QT_LOGGING_RULES="org.kde.elisa.baloo.debug=true" elisa' is quite useful. keeping this here for easy finding by me)

STEPS TO REPRODUCE
1. Point Elisa to a folder which is a symlink
2. Observe that no music is being found by elisa
Comment 1 Alexander Stippich 2019-08-22 18:11:21 UTC
Git commit f980f6e66eb7d3273e73f77cd520cdc4081c545c by Alexander Stippich.
Committed on 22/08/2019 at 18:11.
Pushed by astippich into branch 'master'.

Resolve symlink for file listener

Summary:
Always resolve symlink so that
Baloo indexer works
Related: bug 407918

Test Plan:
remove actual music folder from search path
delete old database
create a symlink to your music folder
add symlink as search path
music is found with patch

Reviewers: mgallien, ngraham

Reviewed By: ngraham

Tags: #elisa

Differential Revision: https://phabricator.kde.org/D23240

M  +10   -3    src/abstractfile/abstractfilelisting.cpp

https://commits.kde.org/elisa/f980f6e66eb7d3273e73f77cd520cdc4081c545c
Comment 2 Luca Weiss 2019-08-22 18:53:46 UTC
So the fix is good when ~/Music is a symlink but this breaks when the root path is set to a subfolder of the symlink, so e.g. /home/luca/Music/ProleteR (where, when the symlink is resolved, it's /mnt/hdd/Music/ProleteR). This stackoverflow answers seems to cover this problem: https://stackoverflow.com/q/16294293/3527128