[REQ] backup and restore auto-playlists

Get help for different MediaMonkey 5 Addons.

Moderators: jiri, drakinite, Addon Administrators

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

Re: [REQ] backup and restore auto-playlists

Post by Lowlander »

Did you put text values in the Criteria (ie. instead of selecting Genre's from the drop-down, entering a genre value manually), then you're right.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: [REQ] backup and restore auto-playlists

Post by ZvezdanD »

By the way, I don't know why the moderator moved this thread to the Addons requests Forum section and changed its subject. The original poster was unsatisfied with the import of playlists in the program itself and I assume that he meant on the import of M3U playlist files. He didn't mention the auto-playlists in his post at all.
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
Rob_S
Posts: 869
Joined: Wed Mar 10, 2021 1:53 pm

Re: [REQ] backup and restore auto-playlists

Post by Rob_S »

I believe the issue he mentioned about not being able to edit the imported playlist referred to auto-playlists, as imported regular playlists can be edited just fine!!! :)

I have no idea why certain things are core, and why certain other things are left to addon developers, this seems to be a sensitive subject, best left unasked???

Personally I think being able to backup and restore separately anything containing significant amount of users work effort should be core.
Using 5.1 LATEST alpha or beta build on Windows 10, HP laptop, managing 13k tracks
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: [REQ] backup and restore auto-playlists

Post by ZvezdanD »

The original poster said: "I have been completely unable to import my playlists DESPITE the fact the media are all stored on an external drive and the file path is exactly the same." This clearly has something with import of M3U playlist files. The issue that you are mentioning was posted by another user and I already answered to him in another thread.

If you don't like to use the add-ons, it is your choice. But please stop insisting and forcing MM developers to implement the same things that the existing add-ons already have (or will have). Many other users are quite satisfied with the add-ons and don't have any issue using them.

Personally, I don't like to spend my time writing the add-ons that will be deprecated just because MM developers decided to make them obsolete, e.g. if they implement the same thing as a "core". I already had that when they decided to ditch the old VBScript add-ons and I don't want to face the same situation again.
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
Lowlander
Posts: 56465
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: [REQ] backup and restore auto-playlists

Post by Lowlander »

As mentioned above by Rusty, there is no plan for a MediaMonkey native solution to transferring AutoPlaylists as AutoPlaylists to a different database. This is being left up to an Addon to accomplish this.
Rob_S
Posts: 869
Joined: Wed Mar 10, 2021 1:53 pm

Re: [REQ] backup and restore auto-playlists

Post by Rob_S »

Pardon me, you are right, that bit of clarification was added by someone else. But I suspect was intended by OP , as the import of regular playlists appears to be flawless and reliable.

As to addon vs core, I don't care too much who supplies it, but it is not something I think I should pay extra for, and sadly for now even that option does not exist.
Using 5.1 LATEST alpha or beta build on Windows 10, HP laptop, managing 13k tracks
Barry4679
Posts: 2398
Joined: Fri Sep 11, 2009 8:07 am
Location: Australia
Contact:

Re: [REQ] backup and restore auto-playlists

Post by Barry4679 »

ZvezdanD wrote: Tue Nov 22, 2022 10:26 am No, the export/import of auto-playlists is not that simple as you think and its complexity is not overstated. That is because the rules for auto-playlists are in almost all cases related to some kind of ID that is specific to the particular database. Not a database ID, but a data ID.

For example, if I have an auto-playlist with a criterion: "Artist" "is" "Pink Floyd", that criterion is not stored in the database as such.
As I said originally I may be over simplifying things, but I did try before making my original post, to force an autoplaylist to be dependent upon row ids. I still don't see any evidence of this. Not even in the example you quote.

Maybe you are thinking of MM4? Maybe this has changed in MM5?

Example this query is stored in the MM5 db as shown below. Pink Floyd was selected from the autplaylist's dropdown list, ie. I did not type the name as text:

Code: Select all

{"conditions":{"autoSortString":"","data":[{[b]"field":"genre","operator":"=","value":"Classic Rock"[/b]}, {[b]"field":"albumArtist","operator":"=","value":"Pink Floyd"[/b]}, {"field":"lastPlayed","operator":"> (days ago)","value":"7"}]},"limit":"files","limitValue":50,"limitOrder":"sort order","matchAllCriteria":true,"sortOrders":[{"field":"title","ascending":true}],"collection":"Entire Library"}
The relevant part is {"field":"albumArtist","operator":"=","value":"Pink Floyd"} .. ie. no IDs which are specific to the database where it was created. And the difficulty of exporting this, appears to me, to be overstated by people like LowLander and Peke.


ZvezdanD wrote: Tue Nov 22, 2022 10:26 am As I said several times already, my Restore/Synchronize Database add-on could export/import auto-playlists in MM4 (and static playlists as well) and its port for MM5 is planned.
Who knows what anyone says here, or what they actually replying to?
It is so confusing when LowLander jerks everybody around, by relocating posts into other threads, and or other forums.
I know that in many cases it helps discoverability, but he overdoes it sometimes, which really pisses me off TBH


Rob_S wrote: Tue Nov 22, 2022 7:18 pm As to addon vs core, I don't care too much who supplies it, but it is not something I think I should pay extra for, and sadly for now even that option does not exist.
I have a view on this.
I think it is to everybody's' benefit if there is a healthy active community of developers are working to extend MediaMonkey.
I don't think that anyone would expect to be paid for small utilities, that someone made for their own benefit, and were happy to share.

But I think that it is OK, and is important, to pay for addons containing significant amounts of work and skill, which are well supported. ZvezdanD is a clear example of this.

Then there is question about whether something is "core".
I have a very long list of disappointments about what did not make its way the "core" of the new generation of MM5.
I am not convinced that export|import of auto playlists is one of those cases. I am OK for things like that to be add-ons.

Once someone has spent the effort to make an add-on, and it has become successful, and the author is serving customers well ... then Ventis should be careful to treat that Developer well.

As far as I can see, they are largely respectful of this.
Want a dark skin for MM5? This is the one that works best for me .. elegant, compact & clear.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: [REQ] backup and restore auto-playlists

Post by ZvezdanD »

Yes, I am thinking about MM4 version of the database. MM5 has added the QueryDataJSON field that you are talking about, which didn't exist before, but if you look at the QueryData field you will see that the conditions still use IDs instead of real values. Something like this:
DBField=Artists.Artist
Condition=301
Value=943

Besides, how would you export/import criterion like: "Playlist" "is" "something"? Did you look at its JSON representation? In that case it is like this: {"field":"","operator":"=","value":"7"} where the "7" is the ID of the specified playlist. And who knows what else is still not represented in JSON directly, but by IDs.

I didn't try yet, but I suspect that it is not enough to just export/import the QueryDataJSON field for auto-playlists to work correctly. I suppose that you need to have exported/imported the QueryData field as well with all its corresponding IDs.

EDIT: I just tried a very simple test. I replaced the artist name in JSON field with another artist name using an external SQLite program with closed MM, without changing anything to the QueryData field, and when I started MM it showed tracks from the old artist. So, it seems that MM doesn't use QueryDataJSON field for its display at all, and that IDs are still the only way how auto-playlists work.
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
Peke
Posts: 17446
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: [REQ] backup and restore auto-playlists

Post by Peke »

Hi,
Zvezdan is right here we often use IDs from DB to ensure reference to specific field of search/criteria in Auto-Playlist as like Zvezdan pointed. One of reasons is that you can rename Playlist and reference in other playlist would be broken or MM would need to go thru all other playlists and change it. Which would be performance hit, while ID stays same.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Barry4679
Posts: 2398
Joined: Fri Sep 11, 2009 8:07 am
Location: Australia
Contact:

Re: [REQ] backup and restore auto-playlists

Post by Barry4679 »

ZvezdanD wrote: Wed Nov 23, 2022 3:07 am Besides, how would you export/import criterion like: "Playlist" "is" "something"? Did you look at its JSON representation? In that case it is like this: {"field":"","operator":"=","value":"7"} where the "7" is the ID of the specified playlist. And who knows what else is still not represented in JSON directly, but by IDs.

I didn't try yet, but I suspect that it is not enough to just export/import the QueryDataJSON field for auto-playlists to work correctly. I suppose that you need to have exported/imported the QueryData field as well with all its corresponding IDs.
I only reviewed it until I got bored. I didn't test it exhaustively.
I didn't test "playlist" inclusion criteria, and as you say, I now see that that does contain an ID.
I noticed what I was hoping to see, in the QueryDataJSON column, and didn't look too closely at anything else.
ZvezdanD wrote: Wed Nov 23, 2022 3:07 am EDIT: I just tried a very simple test. I replaced the artist name in JSON field with another artist name using an external SQLite program with closed MM, without changing anything to the QueryData field, and when I started MM it showed tracks from the old artist. So, it seems that MM doesn't use QueryDataJSON field for its display at all, and that IDs are still the only way how auto-playlists work.
Even if MM5 cannot run the queries using JSON data, that data would greatly ease the task of migration IMO ... unless someone, like you, already had all the code required to rebuild everything by comparing paths, and deducing IDs for the new target database, etc etc :)

I would guess that they could alter the JSON field to use playlist title instead of its ID. ... It seems to have a bug there that could be fixed anyway, because that field name is blank.

I suppose a migration using JSON data method would have an issue in databases where there was many tag duplicates ... ie. multiple tracks which have the same tag value, where that tag value is used as a selection criteria ... I wouldn't think that would be a show stopper though.
Want a dark skin for MM5? This is the one that works best for me .. elegant, compact & clear.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: [REQ] backup and restore auto-playlists

Post by ZvezdanD »

The JSON data would not "greatly ease the task of migration", it is opposite. The MM5 version of the add-on now should synchronize data not only in one field, but in two. It would be even more complicated than before.
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
Barry4679
Posts: 2398
Joined: Fri Sep 11, 2009 8:07 am
Location: Australia
Contact:

Re: [REQ] backup and restore auto-playlists

Post by Barry4679 »

ZvezdanD wrote: Wed Nov 23, 2022 10:50 am The JSON data would not "greatly ease the task of migration", it is opposite. The MM5 version of the add-on now should synchronize data not only in one field, but in two. It would be even more complicated than before.
There is probably no need to recreate the JSON data. Probably you could leave it empty. Nothing seems to use it when running, or altering an auto playlist.

I am not in a position to argue with you, because you are the expert here.
I know that you are thinking of a "superior" migration utility, while I am thinking of just an "adequate" utility.
"Adequate" in the sense that it would do a good enough job, although it had trouble where the user had made changes to tags referenced in criteria clauses.
I still think that the new JSON field enables creation of an less complex "adequate" migration facility, if there were use for such a thing.

But this is whole bag of worms anyway. ...ie. using IDs only gives partial protection.
eg. if I select an album, and retag the artist name, this creates an new row in the artist table, with a new ID ===> auto playlist is broken. The user needs to know that they can't do that, they need to go to the detail panel for the artist, and do the rename there.

If I retag the albumartist for all tracks for an album, it creates a new Album ID ====> auto playlists are broken here,

Also if the user does a database rebuild (new in MM5), it re-assigns all album IDs, so maybe this ==> breaks all auto playlists containing album equals criteria ... I am guessing here ... I tested the above cases, but not this.
Want a dark skin for MM5? This is the one that works best for me .. elegant, compact & clear.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: [REQ] backup and restore auto-playlists

Post by ZvezdanD »

This is not about "adequate" or "superior". It is about "functioning" and "reliability". To be able to export/import auto-playlists, the IDs in QueryData field should be synchronized between the backup and current databases, as it is already implemented in MM4 version. If that part is not done correctly, or even skipped, the data will not be synchronized, so you could get e.g. "Eminem" instead of "Pink Floyd", as my experiment proved.

Using the JSON field is useless in that part, it just complicates things. And I don't want to leave that field non-synchronized or even empty because that could cause who knows what kind of trouble. It was added in MM5 with a reason and I am sure that the program is using it for something.
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
Barry4679
Posts: 2398
Joined: Fri Sep 11, 2009 8:07 am
Location: Australia
Contact:

Re: [REQ] backup and restore auto-playlists

Post by Barry4679 »

ZvezdanD wrote: Thu Nov 24, 2022 6:17 am This is not about "adequate" or "superior". It is about "functioning" and "reliability". To be able to export/import auto-playlists, the IDs in QueryData field should be synchronized between the backup and current databases, as it is already implemented in MM4 version. If that part is not done correctly, or even skipped, the data will not be synchronized, so you could get e.g. "Eminem" instead of "Pink Floyd", as my experiment proved.

Using the JSON field is useless in that part, it just complicates things. And I don't want to leave that field non-synchronized or even empty because that could cause who knows what kind of trouble. It was added in MM5 with a reason and I am sure that the program is using it for something.
I am just reporting about what I would be needing or wanting from a playlist import utility. You have a different higher goal in mind, so that is good. I presume that we see and use playlists differently, and place a different degree of importance upon them.

It is good that you aim to take more care of playlists than MM does itself. ... ie. as reported in my earlier post, they are OK to break playlist criteria links when a user does some simple retagging, despite the fact that the playlists are ID based.

Also it is ironic that your meticulous approach presumably would have a worse outcome where a user has retagged a track to add or change an albumartist tag. ... ie. the JSON data in the source MM database would still be correct, but the ID has been broken ... that's what I see.
Want a dark skin for MM5? This is the one that works best for me .. elegant, compact & clear.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: [REQ] backup and restore auto-playlists

Post by ZvezdanD »

Again, this is not a "higher goal", it is a necessary goal if you want to get reliable data. If you don't use correct IDs, you will get mismatched data. The JSON field cannot help with that, it is just an additional complication for the add-on.

As I said before, the correct synchronization of data "is already implemented with my add-on. It could find the corresponding IDs just fine, even if you want to export/import data from/to non-related databases." The new version should just additionally synchronize JSON field (most probably only these rules in records that contain IDs, like the mentioned "Playlist") and that is it.

I am not sure that understand your mentioning of "break playlist criteria links when a user does some simple retagging" and "the JSON data in the source MM database would still be correct, but the ID has been broken". Could you please give a more detailed explanation or steps to reproduce?
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
Post Reply