Restore/Synchronize Database 3.1.2 (2013-08-31) [MM3+]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

musicmann

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-08-26)MM3]

Post by musicmann » Fri Aug 28, 2009 5:34 pm

Hello,

Am not really sure how this thing works.. but was wondering what if the path of the files changed? Would it be able to update it correctly? how about if the format changed from mp3 to flac? just curious..
sounds really cool though. :) will definitely back up my files using this too.. as a 2nd failsafe.. Thanks a lot!

ZvezdanD
Posts: 3089
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-08-26)MM3]

Post by ZvezdanD » Sat Aug 29, 2009 12:26 am

musicmann wrote:Am not really sure how this thing works.. but was wondering what if the path of the files changed? Would it be able to update it correctly? how about if the format changed from mp3 to flac?
I think that I answered on this in the Description and What is new sections of the first post of this thread, as well as in the several further posts, but here it is again. The track from the backup file is considered as matched with the track from the current database file if they have same:
1. full paths OR
2. checksums OR
3. filename with extension AND FileLength AND Album AND Year AND TrackNumber OR
4. filename without extension AND SongLength AND Artist AND Album AND Year AND TrackNumber.

The fourth criterion is added in the last update and it covers situations with different audio formats in backup and current databases. 2-4. criteria have the true condition only if there are exactly two matched tracks - if there are three or more tracks matched with those criteria, they would return the false condition and such tracks should have same full paths to be considered as matched.
musicmann wrote:will definitely back up my files using this too.. as a 2nd failsafe..
This script is not intended to make backups, just to restore mentioned data from some existing backup file. You could make backup files using trixmoto's Backup script or manually by simply copying of MM.DB file to some safe storage.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1 / 5.4  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.7 / 4.0  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.3 / 2.2.2  Inherit Child Playlists 1.0.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

musicmann

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-08-26)MM3]

Post by musicmann » Sat Aug 29, 2009 1:17 am

Ooohh.. Thank you ZvezdanD for making things clear for me. have to be honest, the description on the first post left me confused.. sorry.. Guess it was too much for me to take in all at once..
I thought it made a backup file as well.. oops. I think I understand what the script is about now.. thank you!!

Teknojnky
Posts: 5533
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-08-26)MM3]

Post by Teknojnky » Tue Oct 20, 2009 7:00 pm

I just want to say thanks, everything seemed to work perfectly.

I finally got around to scanning a new db and restoring the playhistory/dates/playlists from my ~750 meg database that had originally been around/upgraded since mm 2.4ish.

I don't know if there were really any issues affecting my original db, but it feels nice to have a clean and newly generated db while still retaining historical info and playlists.

So, thank you!

For the curious, it took about 2 minutes to load the backup db, and I think it was ~80 seconds to import the info to the current db on my external drive/q6600 quadcore.

debu
Posts: 158
Joined: Fri May 11, 2007 9:52 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-08-26)MM3]

Post by debu » Sun Nov 15, 2009 11:50 pm

I'm trying to merge an old database (for playlists) into my current one. I've installed your script and get the following messages after selecting the old database and clicking restore:

Error #457 - Microsoft VBScript runtime error
This key is already associated with an element of this collection
File: "C:\Program Files\MediaMonkey\Scripts\RestorePLayHistory.vbs". Line 346 Column : 20

I close that error window and get another window that says:

Error happened during script execution:
This key is already associated with an element of this collection

Do you have any idea what these messages are about? thanks

wutzin
Posts: 72
Joined: Thu Jul 03, 2008 9:18 am

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-08-26)MM3]

Post by wutzin » Mon Jan 04, 2010 6:34 pm

absolutely awesome - I just corrupted my library (apparently by using MM under Win7, see http://www.mediamonkey.com/forum/viewto ... =7&t=45426 and http://www.mediamonkey.com/forum/viewto ... =7&t=44781), so I need to rebuild my library.
Rescued my playlists, but thought the other info was lost - not anymore! Thanks so much, will try this out...

cheers,

Christian

wutzin
Posts: 72
Joined: Thu Jul 03, 2008 9:18 am

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-08-26)MM3]

Post by wutzin » Fri Mar 26, 2010 7:31 pm

I absolutely love this script!!! No more worrying about losing data if you screw up your library. Simply start from scratch, rescan all your folders and then let this beast import all your ratings, playcounts, playlists, dateAdded to your sparkling-new library.

Works perfectly for me and saves me a LOT of trouble (somehow I manage to corrupt my library pretty regularly..)

ZvezdanD
Posts: 3089
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-08-26)MM3]

Post by ZvezdanD » Thu Apr 01, 2010 8:19 pm

wutzin wrote:I absolutely love this script!!! No more worrying about losing data if you screw up your library. Simply start from scratch, rescan all your folders and then let this beast import all your ratings, playcounts, playlists, dateAdded to your sparkling-new library.

Works perfectly for me and saves me a LOT of trouble (somehow I manage to corrupt my library pretty regularly..)
Hey, thanks for the kind words. By the way, this addon cannot import ratings, but I think it is not necessary since ratings are stored inside of audio files. However, if someone really need such possibility, please let me know.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1 / 5.4  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.7 / 4.0  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.3 / 2.2.2  Inherit Child Playlists 1.0.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

ZvezdanD
Posts: 3089
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-08-26)MM3]

Post by ZvezdanD » Thu Apr 01, 2010 8:24 pm

debu wrote:I've installed your script and get the following messages after selecting the old database and clicking restore:

Do you have any idea what these messages are about?
Well, if you are still interested, I think that you have playlists with the same name on the level. This addon cannot handle such case, but you could try updated version (1.4.1) which at least doesn't generate the error message in such situation:

- Fixed: error when database contains multiple playlists with same name on same folder level.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1 / 5.4  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.7 / 4.0  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.3 / 2.2.2  Inherit Child Playlists 1.0.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

Lowlander
Posts: 46080
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

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

Post by Lowlander » Mon Apr 19, 2010 12:26 pm

Looks promising, I have a question though? Do you need the checksums or can it sync play count based on file path? Also can it sync playcounts both ways? How does it handle when files aren't in one of the databases (I don't want them added)?
Lowlander (MediaMonkey user since 2003)

ZvezdanD
Posts: 3089
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD » Mon Apr 19, 2010 12:44 pm

Lowlander wrote:Do you need the checksums or can it sync play count based on file path?
You, my friend, are not reading description section from the first post nor the previous posts from this same page? ;) Here it is again:
"The track from the backup file is considered as matched with the track from the current database file if they have same:
1. full paths OR
2. checksums OR
3. filename with extension AND FileLength AND Album AND Year AND TrackNumber OR
4. filename without extension AND SongLength AND Artist AND Album AND Year AND TrackNumber.

The fourth criterion is added in the last update and it covers situations with different audio formats in backup and current databases. 2-4. criteria have the true condition only if there are exactly two matched tracks - if there are three or more tracks matched with those criteria, they would return the false condition and such tracks should have same full paths to be considered as matched."
Lowlander wrote:Also can it sync playcounts both ways?
I am not sure what you mean with that? You could always rename current database, move your backup MM.DB file to the MM database folder, open MM with that file and restore play counts from the previous current DB to the backup file, so I assume this is "yes" to your question.
Lowlander wrote:How does it handle when files aren't in one of the databases (I don't want them added)?
Well , it cannot handle tracks if they don't exist. It could only merge data between matched track. If your current database doesn't contain some track which is contained in the backup DB file, then there is nothing to restore/merge. Are you suggesting that I should add an option to import tracks from the backup DB file that are not contained in the current database file?
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1 / 5.4  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.7 / 4.0  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.3 / 2.2.2  Inherit Child Playlists 1.0.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

Lowlander
Posts: 46080
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

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

Post by Lowlander » Mon Apr 19, 2010 1:05 pm

ZvezdanD wrote:You, my friend, are not reading description section from the first post nor the previous posts from this same page? ;)
I clearly missed it.
ZvezdanD wrote:Are you suggesting that I should add an option to import tracks from the backup DB file that are not contained in the current database file?
No, I don't want it to add tracks that weren't in the database.

Last question: If you run this script twice does it add play counts twice or does it also see if the played date already exists and thus skip it?
Lowlander (MediaMonkey user since 2003)

ZvezdanD
Posts: 3089
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD » Mon Apr 19, 2010 2:01 pm

Lowlander wrote:If you run this script twice does it add play counts twice or does it also see if the played date already exists and thus skip it?
No, it will not add play counts twice if you run add-on twice. It will compare playing dates from Played tables of backup and current DB files and if they are same it will not count it.

By the way, you need to have the correct Played table with all play history in both database files, it is not enough to have filled just Playcount and LastTimePlayed fields in the Songs table. If you are using MM for the reproduction on PC, then the Played table is correctly populated whenever you play some track, but I am not sure how this is going with imported/synchronized play history from iPod or similar hardware player. Maybe in such situations should be used Bex's Add/Remove PlayStat.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1 / 5.4  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.7 / 4.0  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.3 / 2.2.2  Inherit Child Playlists 1.0.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

Lowlander
Posts: 46080
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

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

Post by Lowlander » Thu Apr 22, 2010 2:05 pm

Wow, this is cool, script imported play data from another PC. This will allow me to get play data from clients on the network and add it to the main database. I did get 4 MediaMonkey error messages popping up on 3 occasions while running the script.
Lowlander (MediaMonkey user since 2003)

ZvezdanD
Posts: 3089
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD » Thu Apr 22, 2010 2:46 pm

Lowlander wrote:I did get 4 MediaMonkey error messages popping up on 3 occasions while running the script.
This should not happen. It would be nice if you post screen-shots, or at least to write the number of the line where error occurred.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1 / 5.4  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.7 / 4.0  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.3 / 2.2.2  Inherit Child Playlists 1.0.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

Post Reply