Skip to content

Collection scanner faster

Hi,

Using a (old) NAS (Network Area Storage), it could be very long to get new album listed in Lollypop (like 1 hour depending on NAS activity... yes is a very old one).

So I propose a more streaming way to update Lollypop database. I choose to divide scan into 3 steps :

  1. Quick scan (just scan latest modified files)
  2. Deep scan (actual scan a little bit improved)
  3. Handle auto-update (directories monitored)

Here, an example of a database with 30000 tracks, 2400 albums, 3500 monitored directories:

  • Actual execution time of CollectionScanner::__scan() (about 12 minutes) : [DEBUG] 2019-01-06 15:35:34 lollypop.collectionscanner::__scan: execution time 12:29.005664

  • Proposal execution time of CollectionScanner::__scan() (about 9 minutes) : [DEBUG] 2019-01-06 15:41:35 lollypop.collectionscanner::__scan_quick: execution time 3:30.291753 [DEBUG] 2019-01-06 15:47:04 lollypop.collectionscanner::__scan_deep: execution time 5:29.385914 [DEBUG] 2019-01-06 15:47:16 lollypop.collectionscanner::__scan: execution time 9:11.603190

Following this example, a new album will be listed at worst in 3 minutes.

Also, deep scan has its progress bar reviewed. It indicates number of processed files. Progress bar could be improved because of 2 steps are not covered.

What do you think about it?

Merge request reports