Bug 391892 - Please optimize update of music library on each start of Elisa
Summary: Please optimize update of music library on each start of Elisa
Status: RESOLVED FIXED
Alias: None
Product: Elisa
Classification: Applications
Component: general (show other bugs)
Version: 0.0.81
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Matthieu Gallien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-15 16:33 UTC by david_k
Modified: 2018-05-09 19:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description david_k 2018-03-15 16:33:06 UTC
Each time I open Elisa it rebuilds the whole music library again. It happens automatically, I don't have to do anything.
Comment 1 david_k 2018-03-15 16:34:54 UTC
My library is a bigger one: 17k songs / 300GB if that matters.
Comment 2 Matthieu Gallien 2018-03-26 19:38:19 UTC
This is not a bug but intended behavior.
When Elisa is not running, your music files may change (added, removed modified files). It is important that Elisa checks that it has an up to date list of your music. This is why on each start, it will index it.
I plan to add an optimization allowing to mostly skip unchanged files.

I consider it very important to not require the user to click on some "update database" menu entry or buttons like seen on some music players. The software should be helping the user and not the opposite.

The optimization will not make it to the 0.1 release.

Do you want to help to have it land quickly in master ?
Comment 3 Matthieu Gallien 2018-03-26 19:43:05 UTC
I am very sorry. I have forgotten to say some important things.

Thanks for having reported this. Sorry to have taken quite some time to answer. Your report is important and helpful.
Comment 4 david_k 2018-03-27 08:06:45 UTC
Thanks for the answers. I get your point and I can agree with this philosophy, but there are users with large, mostly unchanged libraries which are being scanned all the time, in most cases needlessly. What's your opinion on including an option for disabling this auto-scan? In this way users like me could disable scanning and re-enable it when needed, and casual users (with smaller libraries) wouldn't have to do a thing to keep their library up to date. I realize Elisa is a simple player for basic needs, but I really like the look and the idea behind it, and I don't need much more, just a better integration in KDE's tray (no pause button at this time, only skipping) and the ability to read cover art from files (I know it's planned).

How can I help with that? I'll do what I can but unfortunately don't have any developer skills, sorry.

Anyway, thanks for your work and taking the time for answering all of these!

Regards,

David
Comment 5 Alexander Stippich 2018-03-27 19:14:55 UTC
The issue with KDE's tray should already be resolved with the latest version.
Comment 6 Matthieu Gallien 2018-03-27 19:15:35 UTC
(In reply to david_k from comment #4)
> Thanks for the answers. I get your point and I can agree with this
> philosophy, but there are users with large, mostly unchanged libraries which
> are being scanned all the time, in most cases needlessly. What's your
> opinion on including an option for disabling this auto-scan? In this way
> users like me could disable scanning and re-enable it when needed, and
> casual users (with smaller libraries) wouldn't have to do a thing to keep
> their library up to date. I realize Elisa is a simple player for basic
> needs, but I really like the look and the idea behind it, and I don't need
> much more, just a better integration in KDE's tray (no pause button at this
> time, only skipping) and the ability to read cover art from files (I know
> it's planned).

I understand your concern but my goal is to have a solution to avoid having to manually manage that. If I fail to do that, rest assured that I will provide the manual way. I am usually testing with a library of 38k files. So you should be confident that my results will be applicable to you.

> How can I help with that? I'll do what I can but unfortunately don't have
> any developer skills, sorry.

Testing and providing feedback is very much appreciated. This is definitely a good way to help.

> Anyway, thanks for your work and taking the time for answering all of these!
> 
> Regards,
> 
> David
Comment 7 Matthieu Gallien 2018-04-29 07:18:48 UTC
Work is ongoing via phabricator task https://phabricator.kde.org/T7603
Comment 8 Matthieu Gallien 2018-05-04 21:44:58 UTC
(In reply to Matthieu Gallien from comment #7)
> Work is ongoing via phabricator task https://phabricator.kde.org/T7603

If you can, could you test this patch https://phabricator.kde.org/D12703 ?

The work is not finished yet but starting the application should be much faster and the disk and cpu activity should be much lower.
Comment 9 Matthieu Gallien 2018-05-05 06:05:10 UTC
I forgot to say that the database file containing a cache of all your tracks will need to be removed after testing. It is usually in $HOME/. local/share/elisa/elisaDatabase.db
Comment 10 Matthieu Gallien 2018-05-09 19:28:45 UTC
Git commit d5a4d2b8f77f26cbba44579c3659d4afec12501b by Matthieu Gallien.
Committed on 09/05/2018 at 19:28.
Pushed by mgallien into branch 'master'.

avoid scanning a file again if it has not been modified

Summary:
avoid scanning a file again if it has not been modified

ensure we get correct behavior on application start with existing tracks

clean up of obsolete way to track removed tracks between application starts

do not yet remove tracks that have been removed when the application was not
running. This is a regression that I will fix later.

Test Plan: mostly works but subsequent starts are much faster

Reviewers: #elisa, astippich

Reviewed By: #elisa, astippich

Subscribers: astippich, januz

Maniphest Tasks: T7603

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

M  +0    -236  autotests/databaseinterfacetest.cpp
M  +86   -0    autotests/localfilelistingtest.cpp
M  +4    -21   src/abstractfile/abstractfilelistener.cpp
M  +1    -13   src/abstractfile/abstractfilelistener.h
M  +51   -17   src/abstractfile/abstractfilelisting.cpp
M  +11   -12   src/abstractfile/abstractfilelisting.h
M  +16   -8    src/baloo/localbaloofilelisting.cpp
M  +1    -1    src/baloo/localbaloofilelisting.h
M  +84   -260  src/databaseinterface.cpp
M  +11   -4    src/databaseinterface.h
M  +1    -0    src/elisaqmlplugin.cpp
M  +0    -2    src/elisautils.cpp
M  +5    -2    src/file/localfilelisting.cpp
M  +1    -1    src/file/localfilelisting.h
M  +1    -1    src/musicaudiotrack.cpp
M  +15   -42   src/musiclistenersmanager.cpp
M  +4    -4    src/musiclistenersmanager.h
M  +0    -1    src/qml/TrackImportNotification.qml

https://commits.kde.org/elisa/d5a4d2b8f77f26cbba44579c3659d4afec12501b