Page 6 of 17

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Thu Aug 05, 2010 8:14 pm
by nynaevelan
Unfortunately Z I think the number of users who want to retain their data from db to db is in the minority, but rest assured this script is still a part of my must have list. It is used regularly when rebuilding my db on my laptop and work computers.

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Fri Aug 06, 2010 9:52 pm
by MattTown
Hi, just wanted to add my vote for the value of this script. I have moved my MM installation through several PC upgrades and have managed to lose the playhistory/dateadded/playlists data in each move, probably because "TURN OFF FILE MONITOR" isn't written in large letters in the "move database" wiki and the monitor process at first start on the new machine overwrote the original values before I understood what was happening. So, I will be using this script to recover the original values from old DB copies.

Thanks in advance.

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Fri Aug 27, 2010 12:15 pm
by martialartsguy
Just re-used this script again after a computer crash and new MM3 install. Great job, but I have one comment.

After re-adding all my tracks to MM, I used this script to restore my play history, date added and playlists, but noticed an odd problem. Some of my playlists were mislabeled, pointing to the wrong artist or album. I've since gone through and manually changed these playlists, but was just wondering if that was an error anyone else has had?

Other than this, no problems whatsoever, great script!

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Fri Aug 27, 2010 2:53 pm
by ZvezdanD
martialartsguy wrote:Some of my playlists were mislabeled, pointing to the wrong artist or album.
I am not sure how this is possible. I think it could happen only if you have tracks before and after the backup with same path or checksum, but changed artist or album. Here is the precedence of checking if some track from the backup database is matched with tracks from the new database:

1. full paths (folder\filename.extension)
2. checksums (made after click on Files To Edit / Duplicate Content)
3. filename with extension AND FileLength AND Album AND Year AND TrackNumber
4. filename without extension AND SongLength AND Artist AND Album AND Year AND TrackNumber.

As you could see, if some track from the backup has same path as some track from the new database, it is considered as matched even if they have different artist, album, tracknumber...

If you think this is not the case, it could be helpful if you send me your backup and new (right after adding tracks) database files, so I could try to reproduce this problem. Please, send me PM and I would describe you how to send me files.

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Sat Aug 28, 2010 1:41 am
by Saiyavenger
This is really gonna come in handy if I do decide to redo my library. Major props.

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Wed Sep 01, 2010 10:05 pm
by martialartsguy
ZvezdanD wrote:
martialartsguy wrote:If you think this is not the case, it could be helpful if you send me your backup and new (right after adding tracks) database files, so I could try to reproduce this problem. Please, send me PM and I would describe you how to send me files.
PM Sent.

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Thu Sep 02, 2010 2:33 pm
by ZvezdanD
martialartsguy wrote:PM Sent.
Thanks for sending me your databases. You are right, there is a problem with autoplaylists. Unfortunately, this problem is too complicated to resolve and I am not sure if I would do anything about it. If you are interested about technical details, you could read my further explanation.

Each autoplaylist is represented with one record in Playlists table of database. That table has QueryData field which contains hex encoded settings of particular autoplaylists that is originally in some kind of ini form, something like this:

[AdvCond1]
DBField=Artists.Artist
DBFieldPerType=1
Condition=301
Value=295

So, instead of your autoplaylist condition "Artist" "is" "H.P. Lovecraft", the database has stored something like Artists.Artist = 295. That number is ID of that artist in the old (backup) database and that artist have another ID in the new (current) database because of different adding order. Also, I suppose that Condition=301 is replacement for "is" condition that you have in Autolaylist dialog box. As you could see, this is all undocumented with so many unknown variables, since each autoplaylist could contain many conditions with different fields and because of that it is hard to resolve.

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Thu Sep 02, 2010 2:38 pm
by martialartsguy
Wow, I think I get it. So basically when a new DB is created, it also creates the new numbering for the artist, etc., correct?

I guess I'll have to figure out another way to organize my playlists, or another way to back them up. Still, this script is awesome for the playhistory & date added! :D

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Thu Sep 02, 2010 2:47 pm
by Lowlander

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Thu Sep 02, 2010 3:43 pm
by ZvezdanD
martialartsguy wrote:So basically when a new DB is created, it also creates the new numbering for the artist, etc., correct?
Yes, exactly.

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Thu Sep 02, 2010 3:44 pm
by ZvezdanD
Lowlander wrote:Try Backup Playlist: http://mediamonkey.com/forum/viewtopic. ... p+playlist
It has the same problem, just tried and looked at its source code.

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Thu Sep 02, 2010 6:55 pm
by martialartsguy
Bummer that...if I remember rightly, that's why I quit using that script a while ago.

Going to have to rethink my backup plan. Thanks for your help Lowlander, and a special thanks to Zvezdan!

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Posted: Fri Sep 03, 2010 3:10 pm
by ZvezdanD
martialartsguy wrote:Going to have to rethink my backup plan.
Actually, only auto-playlists with Tempo/Mood/Occasion/Quality "is" and Genre/Artist/Album Artist/Composer/Conductor/Lyricist "equal/not equal" conditions are (was) affected. Anyway, there is the new release with resolved that problem: v1.4.2 - 2010-09-03
* Fixed: problem with some auto-playlists.

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2010-09-03

Posted: Sun Oct 31, 2010 11:11 pm
by Dreadlau
Hello.

I just wanted to thank you for the script.
It worked perfectly and it's very handy.

Just a little inconvenience. After the script finished his work.
It showed the confirmation message hidden behind the main Mediamonkey window.
At first I thought my Mediamonkey was frozen until I clicked on the MM taskbar icon to show the message.

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2010-09-03

Posted: Mon Nov 01, 2010 2:01 am
by ZvezdanD
Dreadlau wrote:I just wanted to thank you for the script.
It worked perfectly and it's very handy.

Just a little inconvenience. After the script finished his work.
It showed the confirmation message hidden behind the main Mediamonkey window.
At first I thought my Mediamonkey was frozen until I clicked on the MM taskbar icon to show the message.
I am glad that you found it useful. Yes, I am aware about the mentioned behavior. Unfortunately, it is not up to my add-on, but because of some bug in MM with its window's focus. I reported many times about these irregularities, but MM developers haven't done anything about it. I hope that MM 4.0 would be better in regard with that, but don't count on it too much.