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

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

kiwichick
Posts: 331
Joined: Tue Jul 21, 2009 6:35 am

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by kiwichick »

Thanks Nyn, I've tried the replace 0 with 1 but it hasn't helped. I did try the RegExpFind&Replace suggestion and that works. I think I might start again with a clean install and a new database. So, from what you've discovered, there's nothing wrong with playlists themselves - it's an addon issue? I can use my current MM.DB from which to restore the playlists? Thanks for your help.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by ZvezdanD »

kiwichick wrote:I've tried the replace 0 with 1 but it hasn't helped.
If you are talking about modification of Bex's script, you should replace all occurrences of IsAutoPlaylist=0 to IsAutoPlaylist<>1 (note the different operator). Of course, after you edit some script, you need to restart the program.
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.1 / 5.4.1  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.8 / 4.0.1  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.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by nynaevelan »

kiwichick wrote:Thanks Nyn, I've tried the replace 0 with 1 but it hasn't helped. I did try the RegExpFind&Replace suggestion and that works. I think I might start again with a clean install and a new database. So, from what you've discovered, there's nothing wrong with playlists themselves - it's an addon issue? I can use my current MM.DB from which to restore the playlists? Thanks for your help.
I am still trying to investigate where the problem could have started but in my inexperience I do not think it started with a script, at least I cannot figure out a script which would have modified my playlists. Personally, I think it was either the conversion from mm3 to mm4 or one of the beta versions. Unfortunately I do not have the option of starting a new db without losing my collections, and I do not feel like rebuilding 40 collections, or having to redo the metadata from my videos since all of the metadata does not seem to be saved in the files, so I guess I am stuck trying to repair this db.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
kiwichick
Posts: 331
Joined: Tue Jul 21, 2009 6:35 am

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by kiwichick »

Thanks Nyn, Well I think I might just do a clean MMPortable install and see how that goes. There don't seem to be many people experiencing this problem so maybe it's just something that's become corrupted in my program files.
Ronswanson

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by Ronswanson »

This script has been really helpful to me, thanks!

Quick question, when I try to update the play count/history, the actual play counts don't update, even though the last played dates do. So I have thousands of songs with a last played date with 0 plays. Any idea whats going on?

Also, does this script overwrite play counts and play histories, or does it only add to them?

Thanks!
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by ZvezdanD »

Ronswanson wrote:when I try to update the play count/history, the actual play counts don't update, even though the last played dates do. So I have thousands of songs with a last played date with 0 plays. Any idea whats going on?
The play counts should be updated as well, I have no idea why that is happening to you. I could only suggest that you upload your backup and current databases packed with Zip to some file server like Mediafire, so I would try to reproduce your problem by myself.
Ronswanson wrote:does this script overwrite play counts and play histories, or does it only add to them?
If you turn on the "Clear Played table..." option it would overwrite them, if you turn off that option it will add them (that is already mentioned in the Important section of the first post of this thread).
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.1 / 5.4.1  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.8 / 4.0.1  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.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
ronswanson

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by ronswanson »

Ronswanson wrote:If you turn on the "Clear Played table..." option it would overwrite them, if you turn off that option it will add them (that is already mentioned in the Important section of the first post of this thread).
I only asked because I wasn't sure if the play count stays the same if the backup number is lower, if it adds the backup number to it, or if it uses the backup number if its higher than the current. I had synced my play counts with last.fm using a script and when I ran your script it reverted the sample I was testing back to a lower play count (I didn't have 'clear played table' checked).

Anyway, like I said, I synced my entire database with my last.fm account, so there are only about 350 songs with a last played date and a 0 play count at the moment, here are the two database files if you have time:

http://www.megaupload.com/?d=2ECHXK6X

I really appreciate your help! I have a big library with about 6 years of play history I'm trying to recover! :D
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by ZvezdanD »

ronswanson wrote:I only asked because I wasn't sure if the play count stays the same if the backup number is lower, if it adds the backup number to it, or if it uses the backup number if its higher than the current.
It would be nice if you tell me which track exactly I should take a look. I checked one track (\Discovery\LP\01 Orange Shirt.mp3) which backup have bigger PlayCounter then the imported one, but it has the same (lower) number of plays in Played table, so it seems that you have the number of plays inconsistent with the PlayCounter value. Here is the excerpt from the Important section: "you need to have the correct Played tables 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 interested, here is the simplified algorithm of the script:
1. if you turn on the "Clear Played table" option:
- all plays of matched tracks are removed from Played table;
- all plays of matched tracks are imported from backup into Played table;
- current PlayCounter field = backup PlayCounter field for all matched tracks;
- current LastTimePlayed field = backup LastTimePlayed field for all matched tracks.

2. if you turn off the "Clear Played table" option:
- all non-existent plays of matched tracks are imported from backup into Played table;
- current PlayCounter field after import = current PlayCounter field before import + number of non-existent plays of matched tracks from backup;
- current LastTimePlayed field after import = maximal value of current LastTimePlayed field before import and backup LastTimePlayed field for matched tracks.

Here is your example: you have backup PlayCounter = 8. current PlayCounter = 2, backup plays = 2 and current plays = 2, so current PlayCounter field after import is still = 2 since your number of backup plays is less then backup PlayCounter, i.e. they are inconsistent. I am not sure, but I think that you could use Bex's Add/Remove Playstats add-on.
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.1 / 5.4.1  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.8 / 4.0.1  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.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by ZvezdanD »

I have a question for all users of this add-on. As you could read from my previous post, there is a "problem" with the imported play counts when there is an inconsistency between the PlayCounter (stored in Songs table) and the number of plays stored in the Played table. First of all, you should know about that Played table which is just a list of all plays - whenever some track finishes with its playback, the date/time is stored in that table along with the ID of the played track.

Now, here are some examples. The first two are with the plays that are consistent with the PlayCounter value, i.e. the number of plays = PlayCounter:
1. Backup PlayCounter = 8, PlayCounter before import = 2, the number of matched plays (with the same date/time) = 2 -> PlayCounter after import = 8 (only 6 backup plays are imported);
2. Backup PlayCounter = 8, PlayCounter before import = 2, the number of matched plays = 0 (the backup has different plays than the current database) -> PlayCounter after import = 10 (all 8 plays are imported).

So far all is fine, but the problem is when the plays are not consistent with the PlayCounter value, i.e. the number of plays <> PlayCounter. Here are the results of the current implementation of the script:
3. Backup PlayCounter = 8, backup number of plays = 2, PlayCounter before import = 2, number of plays before import = 2, the number of matched plays = 2 -> PlayCounter after import = 2 (none play is imported);
4. Backup PlayCounter = 8, backup number of plays = 2, PlayCounter before import = 2, number of plays before import = 2, the number of matched plays = 0 -> PlayCounter after import = 4 (only 2 backup plays which are stored in Played table are imported).

As I said in the previous post, if you turn off the "Clear Played table" option, the PlayCounter after import would be a sum of PlayCounter before import and the number of non-existent plays of matched tracks from backup. What I am thinking now is to modify that algorithm to be like this:
PlayCounter after import = Maximum of 2 values(PlayCounter before import + number of non-existent plays of matched tracks from backup, backup PlayCounter)

So, in the 3. and 4. examples the PlayCounter after import would be = 8. What do you think about it?
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.1 / 5.4.1  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.8 / 4.0.1  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.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by nynaevelan »

ZvezdanD wrote:
As I said in the previous post, if you turn off the "Clear Played table" option, the PlayCounter after import would be a sum of PlayCounter before import and the number of non-existent plays of matched tracks from backup. What I am thinking now is to modify that algorithm to be like this:
PlayCounter after import = Maximum of 2 values(PlayCounter before import + number of non-existent plays of matched tracks from backup, backup PlayCounter)

So, in the 3. and 4. examples the PlayCounter after import would be = 8. What do you think about it?
I agree with your assessment, I would prefer that the maximum number be used.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
Ronswanson

Re: Restore PlayHistory/Playlists/Metadata 2.1 (2011-12-09[M

Post by Ronswanson »

Thanks, it makes 100% sense now. I was confusing some of the terminology. :D
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore/Synchronize Database 3.0 (2011-12-09) [MM3+]

Post by ZvezdanD »

There is the new version: v3.0 - 2012-01-09
* Added: possibility to export data to the external (backup) database file;
* Added: possibility to make a backup of the current database;
* Added: option which allows export/import of filters [MM3 db] / collections [MM4 db] and views;
* Added: option Update tags in files as well which could be used only on import;
* Added: new matching test for path without drive letter, first folder & extension (e.g. if the path is c:\Music\Rock\Pink Floyd\Time.mp3, then only Rock\Pink Floyd\Time would be compared) AND SongLength;
* Changed: calculation of PlayCounter if Clear Played table option is turned off, it is now maximum of 2 values(PlayCounter before import + number of non-existent plays of matched tracks from backup, backup PlayCounter);
* Improved: speed in some cases.
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.1 / 5.4.1  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.8 / 4.0.1  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.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Restore/Synchronize Database 3.0 (2011-12-09) [MM3+]

Post by nynaevelan »

Zvezdand:

I tried this but all of my filters were not imported, here is what the original filters table looks like:

Image
original filters by nynaevelan, on Flickr

And here is what the imported filters look like:

Image
imported filters by nynaevelan, on Flickr
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore/Synchronize Database 3.0 (2011-12-09) [MM3+]

Post by ZvezdanD »

nynaevelan wrote:I tried this but all of my filters were not imported
Thanks for the report. There is the new release: v3.0.1 - 2012-01-12
* Fixed: import/export of filters.
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.1 / 5.4.1  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.8 / 4.0.1  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.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Restore/Synchronize Database 3.0.1 (2012-01-12) [MM3+]

Post by nynaevelan »

Thank you, this fixed my issue but I have a question and a future request (hopefully :wink: ).

1. Question: I seem to have duplicate filters now based on the ones that are in MM prior to the import, would it be possible to have an option where the script clears the filter table prior to the import? Or would it be a best practice to delete the filters prior to the import? Or maybe an option to only import specific filters, but this one is not really something I want, just a thought?
2. Request: When I recreate my new db, MM doesn't always put my videos and audiobooks into the correct 'Type", would it be possible to add an option in the import to change the Type to what the file is in the import db? Or would it be better to make sure the Type is correct before an import??

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
Post Reply