![]() |
[IDEA] Progress bar for scanning new library - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: [IDEA] Progress bar for scanning new library (/showthread.php?tid=4525) |
Progress bar for scanning new library - renfrow - 11-12-2021 When you add a new library, and scan it for music, there is an indefinite progress icon near to the menu icon to indicate that it is working on scanning. It would be nice to have a progress bar to indicate how far along you are in the scanning process. To facilitate this use the following command, "find dirctory -type d -links 2 | wc -l", to quickly find how many leaf directories (directories that do not contain sub-directories) are found in 'directory'. The command args are: directory - where to search -type d - only select file system objects that are directories -links 2 - directories that only contain links to parent ('..') and self ('.'), no sub-directories wc -l - count the number of directories returned by the find command Then, as each directory is finished you can update the progress bar. Of course, this is assuming that directories containing music do not contain sub-directories. Thanks! ---- Now, we can do this the hard way, or... well, actually there's just the hard way. -- Buffy Summers, "Buffy the Vampire Slayer" RE: Progress bar for scanning new library - Tim Curtis - 11-12-2021 How do you determine "as each directory is finished"? RE: Progress bar for scanning new library - TookaFace - 11-12-2021 Some rough idea, you could update directory by directory with --wait directive, that way u know when each directory is done Code: IFS=$'\n' RE: Progress bar for scanning new library - Tim Curtis - 11-12-2021 Doing a progress bar for MPD DB update is tricky because MPD only emits events indicating start and end of update. I suppose the MPD log could be monitored since it records any updates made to files. There can also be multiple updates running / queued which could be a complication. |