Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Music lib export/import songs playback history on separate thread from GUI #15864
Fix music import facility to work on separate thread from GUI, hence actually be able to cancel it in the way export works.
Add facility to backup the song playback history e.g. play count, lastplayed date, rating, votes and userrating - all the dynamic data that can change during playback and is not held in the music file itself - to xml file. This means that if users need to remove music sources or move music files to new location they can subsequently restore their playback history, a facility that has been needed fo a long time.
Tested on both SQLite and MySQL music databases with a variety of music collections.
This is low risk and yet offers significant improvement so I would like to get it into v18.
Export: With single file kind of export, "songs" can be selected from the list of items to export. All songs that have been palyed or have a rating will be exported to xml file.
Import: Such an xml file can be used to populate the playcount and rating values of any music library with some or all of the same songs. Say remove the music source, move the files, clean libary and then add a new source. Playback history can be restored from the xml.
The import process can also be cancelled.
A long awaited feature! Thanks @DaveTBlake
I have tested this on my library of approx 300 albums and 2000 songs using your test build.
I artificially increased the play counts, ratings, votes etc in the DB and ran the export. Though I did not check every single line, a quick calculation of line counts and word search count confirms all song, album and artist data was exported.
I cleared the database and re-imported the exported single file xml and all song fields were correctly populated.
I removed Source, renamed it and added it back. Ran the Import again, and all imported correctly.
I stripped away the Album and Artist data out of the XML file, leaving only the song data. This imported correctly into the database, obviously only populating the dynamic song data and not touching anything else.
All good :)
Thanks @KarellenX, Scott has tested too and reported positive results https://forum.kodi.tv/showthread.php?tid=334059&pid=2842938#pid2842938