2014-05-01, 15:02
Hi XBMC users.
When I add movies to the library, XBMC sets "Date Added" to the file creation date. That is exactly how I like it. I use 3rd party tools to add movies to the library which are not recognized by XBMC itself. For example XBNE works great. Unfortunately it adds the new files with the current date in "Date Added" and not the file creation or modification date.
So I wrote a simple python script, which I'd like to share with you, which goes through all movies in the library and changes "Date Added" to each file's last modification date.
Notes:
Link to blog entry with script:
http://www.netzgewitter.com/2014/05/pyth...d-in-xbmc/
Update: 2015-07-27: Added MySQL Database support
Update: 2015-12-06: Updated script to work with a database change in Kode database Version 93
When I add movies to the library, XBMC sets "Date Added" to the file creation date. That is exactly how I like it. I use 3rd party tools to add movies to the library which are not recognized by XBMC itself. For example XBNE works great. Unfortunately it adds the new files with the current date in "Date Added" and not the file creation or modification date.
So I wrote a simple python script, which I'd like to share with you, which goes through all movies in the library and changes "Date Added" to each file's last modification date.
Notes:
- This is not an XBMC AddOn. It’s just a simple python script that manipulates the sqlite video database directly. So handle with care, and back up you video database.
- Also exit XBMC before you run this script.
- This script was tested with XBMC 13.0 Gotham – Beta 4.
- Change the location of your video database in the script accordingly. If you don't know where it is, check this: http://wiki.xbmc.org/?title=Userdata
- If the script does not find file names with special characters, you might change the encoding from ‘cp1252′ to whatever you have. cp1252 is the standard encoding in windows for Western Europe.
- This only changes movie file library entries. Not TV series.
Link to blog entry with script:
http://www.netzgewitter.com/2014/05/pyth...d-in-xbmc/
Update: 2015-07-27: Added MySQL Database support
Update: 2015-12-06: Updated script to work with a database change in Kode database Version 93