2017-10-24, 12:54
tl;dr
I'm guessing my problem must be all the old episodes/documentaries I have that that cannot be scanned/resolved by TheTVDB and those are being searched for before all the most recently added ep's and shows?
I've been using mySQL (running on a 32GB i7 ZFS based server over a Gbps lan) for a few years now with a variety of Kodi endpoints and I've noticed that scanning my TV share (and Movie share to a lesser extent) for new content often takes more than 30 minutes to complete. There doesn't seem to be a default sort order for scanning directories/folders (I've 'tried' looking through the source on github - so I could be wrong), since most users are interested in the content they added most recently wouldn't it make sense to scan by date modified/created in descending order so that the scan will identify the most recently changed folders first and populate those in the Recently Added view/widget that most people now use? This at least gives the perception of a quick scan.
I can see in xbmc/video/VideoInfoScanner.h the reference to using a hash to see if a directory has been modified - so using those hashes along with the descending time-stamps should make scanning very quick. I see in the video107.path table that the majority of my folders (3397/3740) have hash values, are the hashes still being used in this way?
I'm guessing my problem must be all the old episodes/documentaries I have that that cannot be scanned/resolved by TheTVDB and those are being searched for before all the most recently added ep's and shows?
Is there an easy to way to change this - I've never been a C++ dev, but I'm happy to take a look and try to fix/improve this given a few pointers on where the actual directory search takes place?
EDIT: I just did a scan for new content (with debug log enabled) and it took about 90 mins to scan my TV Shows. AFTER this I did another scan that took about 10 mins and quickly noticed in the debug log that many items were skipped this time
So this means that one of my 6 or so kodi devices is generating an invalid checksum that is then causing other boxes to rescan all the directories again. I'm sure they all have the exact same sources.xml and password.xml files, so I wonder if running Update Library on one of my boxes (as opposed to scan for new content) could be causing the directory checksums to change? Unless anyone knows if LibreElec, ShieldTV, AFTV, Win10 and Unbutu see a different directory when scanning across SMB onto a ZFS hosted share, i.e. hidden files, last accessed dates, etc?
Cheers
D.
I'm guessing my problem must be all the old episodes/documentaries I have that that cannot be scanned/resolved by TheTVDB and those are being searched for before all the most recently added ep's and shows?
I've been using mySQL (running on a 32GB i7 ZFS based server over a Gbps lan) for a few years now with a variety of Kodi endpoints and I've noticed that scanning my TV share (and Movie share to a lesser extent) for new content often takes more than 30 minutes to complete. There doesn't seem to be a default sort order for scanning directories/folders (I've 'tried' looking through the source on github - so I could be wrong), since most users are interested in the content they added most recently wouldn't it make sense to scan by date modified/created in descending order so that the scan will identify the most recently changed folders first and populate those in the Recently Added view/widget that most people now use? This at least gives the perception of a quick scan.
I can see in xbmc/video/VideoInfoScanner.h the reference to using a hash to see if a directory has been modified - so using those hashes along with the descending time-stamps should make scanning very quick. I see in the video107.path table that the majority of my folders (3397/3740) have hash values, are the hashes still being used in this way?
Code:
static int GetPathHash(const CFileItemList &items, std::string &hash);
/*! \brief Retrieve a "fast" hash of the given directory (if available)
Performs a stat() on the directory, and uses modified time to create a "fast"
hash of the folder. If no modified time is available, the create time is used,
and if neither are available, an empty hash is returned.
In case exclude from scan expressions are present, the string array will be appended
to the md5 hash to ensure we're doing a re-scan whenever the user modifies those.
\param directory folder to hash
\param excludes string array of exclude expressions
\return the md5 hash of the folder"
Is there an easy to way to change this - I've never been a C++ dev, but I'm happy to take a look and try to fix/improve this given a few pointers on where the actual directory search takes place?
EDIT: I just did a scan for new content (with debug log enabled) and it took about 90 mins to scan my TV Shows. AFTER this I did another scan that took about 10 mins and quickly noticed in the debug log that many items were skipped this time
Code:
DEBUG: VideoInfoScanner: Skipping dir 'smb://chipper/tank_television/him and her/Him.and.Her.S03E01.WS.PDTV.XviD/' due to no change
So this means that one of my 6 or so kodi devices is generating an invalid checksum that is then causing other boxes to rescan all the directories again. I'm sure they all have the exact same sources.xml and password.xml files, so I wonder if running Update Library on one of my boxes (as opposed to scan for new content) could be causing the directory checksums to change? Unless anyone knows if LibreElec, ShieldTV, AFTV, Win10 and Unbutu see a different directory when scanning across SMB onto a ZFS hosted share, i.e. hidden files, last accessed dates, etc?
Cheers
D.