home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
Improvement Suggestions
Req: Music database update speeded up
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="HappyTalk" data-source="post: 67342" data-attributes="member: 22671"><p>Examining the database I see it uses a dwFileNameCRC so I presume it has to re-read each file in its entirety to generate the checksum in order to compare to the original one to detect any changes, I guess this is what is taking the time. Generating a CRC for 40k unchanged records to detect the 14 new ones!</p><p></p><p>I can see that it was done for 100% accuracy in detecting changes but seems to be overkill. I can see 2 solutions:-</p><p></p><p>1) Quick n' dirty. Simply add a date field to the Music | Music database dialog in the MediaPortal Setup, allowing to only add files who's modified date is after this date. This can remember the last date when a previous scan was done as the default value. Obviously this option can be disabled to restore the current functionality. I have already used this method in a program I write for dvdr backing up mp3's/any files to select 4.2gb chunks of files </p><p>after a certain date.</p><p></p><p>2) Replace the filename crc with the last modified date. Obviously it's a lot, lot quicker to compare a files current modified date with it's previous one to detect a change than generating CRC's. You could argue this might in a minority of cases give false results, but in real situations I'm sure 99.9% of the time it would be correct but would save hours and hours of time. Alternatively a 'file_modified_time' field could be added in addition to the CRC flag and a quick scan or long scan (as is now) could be offered. </p><p></p><p>For me the first method is easiest to code as I've already written this before and am about to give it a go to see how it works out.</p></blockquote><p></p>
[QUOTE="HappyTalk, post: 67342, member: 22671"] Examining the database I see it uses a dwFileNameCRC so I presume it has to re-read each file in its entirety to generate the checksum in order to compare to the original one to detect any changes, I guess this is what is taking the time. Generating a CRC for 40k unchanged records to detect the 14 new ones! I can see that it was done for 100% accuracy in detecting changes but seems to be overkill. I can see 2 solutions:- 1) Quick n' dirty. Simply add a date field to the Music | Music database dialog in the MediaPortal Setup, allowing to only add files who's modified date is after this date. This can remember the last date when a previous scan was done as the default value. Obviously this option can be disabled to restore the current functionality. I have already used this method in a program I write for dvdr backing up mp3's/any files to select 4.2gb chunks of files after a certain date. 2) Replace the filename crc with the last modified date. Obviously it's a lot, lot quicker to compare a files current modified date with it's previous one to detect a change than generating CRC's. You could argue this might in a minority of cases give false results, but in real situations I'm sure 99.9% of the time it would be correct but would save hours and hours of time. Alternatively a 'file_modified_time' field could be added in addition to the CRC flag and a quick scan or long scan (as is now) could be offered. For me the first method is easiest to code as I've already written this before and am about to give it a go to see how it works out. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
Improvement Suggestions
Req: Music database update speeded up
Contact us
RSS
Top
Bottom