I recently switched from MediaPortal to XBMC on my living room HTPC. I was using MediaPortal for a long time. But unfortunately it got more and more unstable from release to release. So I gave XBMC a try and so far I am pretty satisfied with it. I really like how fast it is.
When I add movies to the library, XBMC sets “Date Added” to the file creation date. That is exactly how I like it. I am using 3rd party tools to add movies to the library which are not automatically recognized by XBMC itself (e.g. XBNE). I just added a lot of movies with XBNE. Worked great. Unfortunately XBNE added them with the current date in “Date Added”.
So I wrote a simple python script which goes through all movies in the library’s database and changes “Date Added” to the file’s last modification date.
- This is not a XBMC AddOn. It’s just a simple python script that manipulates the sqlite video database directly. So handle with care, and back up your video database.
- Also exit XBMC before you run this script.
- This script was tested with XBMC 13.0 up to Kodi 14.2
- Change the location of your video database in the script accordingly. If you don’t know where it is, check this XBMC Wiki Entry about Userdata location.
- 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 files. Not TV series.
Download from Github: https://github.com/nharrer/kodi-update-movie-dateadded
- Added support for MySQL databases
- Moved script to GitHub. It can now be downloaded here: https://github.com/nharrer/kodi-update-movie-dateadded
- Updated script to work with a database change in Kode database Version 93