ensure that baloo detection works
ClosedPublic

Authored by mgallien on Sep 30 2019, 5:16 AM.

Details

Summary

connect to the signal used to detect baloo earlier such that we detect
it correctly at start

Thanks to Martin Steigerwald for the report on stable branch (but also reproducible on master)

CCMAIL: martin@lichtvoll.de

BUG: 412210

Test Plan

if no elisa files exist (database, kconfig and Qt settings) baloo is detected and used to get audio files

without it, nothing happen at start

Diff Detail

Repository
R255 Elisa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mgallien requested review of this revision.Sep 30 2019, 5:16 AM
mgallien created this revision.
mthw added a subscriber: mthw.Sep 30 2019, 10:15 AM

Is this supposed to fix 412210?

mgallien edited the summary of this revision. (Show Details)Sep 30 2019, 11:39 AM
In D24303#539700, @mthw wrote:

Is this supposed to fix 412210?

Yes. Sorry for missing the connection with the bug. I have fixed that now.

Thanks a lot for your help.

mthw added a comment.Sep 30 2019, 2:48 PM

I am asking because I tried it and it doesn't help. I deleted ~/.config/elisarc, ~/.local/share/elisa/*and ~/.cache/elisa/*; built from source (tag 0.4.2 with this patch) and ran the build. It acts exacty the same as before. Am I doing something wrong? Baloo is running and working corectly (I guess, it's not crashing).

mgallien added a comment.EditedSep 30 2019, 3:24 PM
In D24303#539850, @mthw wrote:

I am asking because I tried it and it doesn't help. I deleted ~/.config/elisarc, ~/.local/share/elisa/*and ~/.cache/elisa/*; built from source (tag 0.4.2 with this patch) and ran the build. It acts exacty the same as before. Am I doing something wrong? Baloo is running and working corectly (I guess, it's not crashing).

Could you add the following environment variable and post the console log?

export QT_LOGGING_RULES="*elisa*=true"

This comment was removed by mgallien.
mthw added a comment.Sep 30 2019, 5:09 PM

@mgallien Is there anything interesting in those logs? What else can I provide to help?

mgallien added a comment.EditedSep 30 2019, 6:31 PM
In D24303#539916, @mthw wrote:

@mgallien Is there anything interesting in those logs? What else can I provide to help?

Thanks for the log.
They show that the fix in this review is enough to have Baloo indexer activate at start.

It looks like there is something else going on.

Are the attached logs full or just the start ?

It looks like some music files are found by Baloo but only on places where Elisa is not looking at (like the source directory of Elisa).

Anyway, let's see what we can do to find generic solutions that would solve your problem and probably those of other people.

mthw added a comment.Sep 30 2019, 6:50 PM

Are the attached logs full or just the start ?

Yes, they are complete. Could this also be caused by something in Baloo? Or somewhere else? Is there a check that Baloo works correctly, afterall it doesn't have the best history? I was thinking about rebuilding the Baloo index but I am hesitant because it has >33k files and ~600MBs - it takes long to refresh. Also it finds files that doesn't exist anymore...

You have two ways to check if baloo index is looking correct:

mthw added a comment.Oct 1 2019, 5:00 AM

You have two ways to check if baloo index is looking correct:

Both methods work correctly so there is most likely nothing wrong with Baloo.

mgallien updated this revision to Diff 67377.Oct 6 2019, 1:28 PM
  • improve logging of what happen during file system scan
  • ensure all tests are OK when built without KFileMetaData
  • do not index twice the files when starting Elisa

added more logging to better understand what happen and fixed some issues related to missing dependencies or uneeded work (indexing happening twice, ...)

mthw added a comment.Oct 6 2019, 6:32 PM

I have re-built with your latest patch, here is the log: https://pastebin.com/evHqy2Bh

FWIW this needs a rebase on current master.

I don't experience the problem, but can confirm that this patch doesn't regress anything for me. The faster scan on startup is nice. That's worth fixing regardless of what goes on here and might be better split out into its own patch. What do you think?

FWIW this needs a rebase on current master.

The reporter is on stable. That is the main reason for working on a fix that applied to stable branch.

I don't experience the problem, but can confirm that this patch doesn't regress anything for me. The faster scan on startup is nice. That's worth fixing regardless of what goes on here and might be better split out into its own patch. What do you think?

I can do that.

mthw added a comment.EditedOct 7 2019, 8:15 AM

Out of curiosity, I've built elisa 0.3.0 and all my music imported imediately without any problems. It must be something that changed since then that broke this.

EDIT: And 0.3.80 seems to be already affected.

mgallien updated this revision to Diff 67452.Oct 7 2019, 7:13 PM
  • should fix indexing stopping for no apparent reason

should fix problem with indexing stopping before having finished the job

In D24303#542653, @mthw wrote:

I have re-built with your latest patch, here is the log: https://pastebin.com/evHqy2Bh

Thanks for the log, I have a good clue now of what is going on.

Let me know if you can test the last iteration.

mthw added a comment.Oct 8 2019, 6:53 AM

After the latest changes, it kind of works. It finds some of my music but not everything.
It looks like the database is created correctly as it contains 1891 tracks which I believe are all my tracks. Also Elisa in top right corner says "1891 tracks imported".

e.g. log says:

...
org.kde.elisa.database: artistsAdded 5
org.kde.elisa.database: albumsAdded 19
org.kde.elisa.database: tracksAdded 184

That is clearly wrong. It shows more items than that, but not everything. There are albums present in the DB that are not shown in Elisa.

In D24303#543481, @mthw wrote:

After the latest changes, it kind of works. It finds some of my music but not everything.
It looks like the database is created correctly as it contains 1891 tracks which I believe are all my tracks. Also Elisa in top right corner says "1891 tracks imported".

e.g. log says:

...
org.kde.elisa.database: artistsAdded 5
org.kde.elisa.database: albumsAdded 19
org.kde.elisa.database: tracksAdded 184

That is clearly wrong. It shows more items than that, but not everything. There are albums present in the DB that are not shown in Elisa.

Thanks for the feedback.
The fact that some tracks are not shown is another subject and there are some reviews already open to work on this.
I believe that this can land now (probably in stable but without a release).

ngraham accepted this revision.Oct 8 2019, 2:11 PM

Yep.

This revision is now accepted and ready to land.Oct 8 2019, 2:11 PM
This revision was automatically updated to reflect the committed changes.