2014-07-28, 06:42
Currently, rescanning the whole music library is inefficient because it causes elements that have not been modified since they were last scanned in, to be unnecessarily acted upon. On large libraries this can prove time consuming (in my case, upwards of 2 days). Thus, for efficiency's sake one is often forced to scan things in one file at a time. This can be time consuming as well, and requires unnecessary manual labor.
I'm wondering if it's possible to instead have XBMC use "indexes" for faster comparison. For instance, I propose this algorithm (assuming XBMC already keeps a list of file URLs with their modification times):
1) search the data sources for the music library to compile a list of file URLs with their corresponding modification times
2) compare the list obtained in 1) with the list XBMC already has
3) identify files that no longer exist, mark them to be cleaned out of the library at the end
4) identify files that are new or changed with respect to the original list, mark them to be scanned into the library. Prioritize new files, then modified files.
5) apply changes
This algorithm has the following gains:
1) avoids having to rescan potentially thousands of files that did not change and thus require no attention
2) allows simplified re-scanning of the library without having to track every single modification for later addition to XBMC (i.e. via the Files... "scan item into library" option)
3) accelerates rescanning of larger collections since only those files that actually require action will be acted upon
Cheers!
I'm wondering if it's possible to instead have XBMC use "indexes" for faster comparison. For instance, I propose this algorithm (assuming XBMC already keeps a list of file URLs with their modification times):
1) search the data sources for the music library to compile a list of file URLs with their corresponding modification times
2) compare the list obtained in 1) with the list XBMC already has
3) identify files that no longer exist, mark them to be cleaned out of the library at the end
4) identify files that are new or changed with respect to the original list, mark them to be scanned into the library. Prioritize new files, then modified files.
5) apply changes
This algorithm has the following gains:
1) avoids having to rescan potentially thousands of files that did not change and thus require no attention
2) allows simplified re-scanning of the library without having to track every single modification for later addition to XBMC (i.e. via the Files... "scan item into library" option)
3) accelerates rescanning of larger collections since only those files that actually require action will be acted upon
Cheers!