Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2+]

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

Moderators: Peke, Gurus

r0k
Posts: 54
Joined: Wed Jul 27, 2011 11:13 am

Unable to search for custom fields

Post by r0k »

Hi. How do i set up a magic node so that it lists all tracks with an empty "Custom 5" field?
I'm using this field to store the PUID generated using PUID generator and would like to know wich songs still need to be processed. I tried modifying the "empty comments" example node, but when i want to see the content, i get an error message telling me to edit the mask.
I tried using "Custom5", "Custom 5", "Songs.Custom5" and "PUID" (the cutom name for this field) but nothing seems to work.
Here is the mask :

Code: Select all

<Group|name:Problematic tracks|Show tracks:No|Child of:FilesToEdit|Position:Last child>\Tracks without PUID|Icon:Top level|Show if empty:No|Filter:<Songs.Custom5> = ''\<Artist|Trim:1>\<Artist>\<Album>
Thanks in avance.
Thanks for this add-on. :)
willyvds
Posts: 439
Joined: Tue Feb 24, 2009 3:30 pm

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by willyvds »

what I suggested wasn't right. Sorry
Regards, Willy
r0k
Posts: 54
Joined: Wed Jul 27, 2011 11:13 am

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by r0k »

OK, looks like it's working now.
When i tried adding the PUID custom name from the GUI (using the add buttons above the filters field, i hope everyone understands what i mean), it got added as Puid with only the first letter in capital. I added it manually by directly editing the filter field and adding PUID (full capitals to match the custom name) and now it's working.

Maybe the "wizard" used to add filters doesn't handle capitals correctly.

Willy, thanks for trying. :)
mikecs83

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by mikecs83 »

I want to make a Magic Node that produced weighted average ratings but gives much higher weight to high ratings. I give very few 5 and 4 star songs so I'd love them to count more.

Any ideas on how to code this would be greatly appreciated.
toof4st
Posts: 65
Joined: Fri Mar 06, 2009 6:13 am

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by toof4st »

Hi ZvezdanD

I wonder if you had any more thoughts on drag/drop onto the unknown node.
I have checked, and MM does allow drag drop onto some unknown nodes. For example, the rating node. If you drop a rated song onto the unknown node under rating, it does clear the rating on that song.

Thanks
toof4st
Posts: 65
Joined: Fri Mar 06, 2009 6:13 am

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by toof4st »

I have another suggestion for MN.
I have a playlist, which I use to maintain the songs which my wife will use sync to her device (so she can maintain a list of songs for the IPod offline - without it being connected)
Now I can easily set up a collection, which lists the tracks in that playlist, which then shows Album Artist > Album, Album nodes etc etc.
But if she wants to remove a track from the playlist, she can't do it from here. If she deletes it, she might actually delete from the computer itself. Which scares me.
(Obviously, she would have to find the tracks in the playlist itself and remove them - but that is way too complicated for her)
What I would like to be able to do is pin some nodes to a playlist, and then if she remove the tracks, all it does is remove it from the playlist (overriding the delete functionality may be tricky)

Maybe there should be a separate script for this, but is seems similar to functionality that MN provides, so I thought I would suggest it here.

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

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by ZvezdanD »

toof4st wrote:I wonder if you had any more thoughts on drag/drop onto the unknown node.
Don't worry, I have already implemented that and it works fine with textual fields, but it needs some more coding for other fields like Year, Rating or BPM.
toof4st wrote:I have checked, and MM does allow drag drop onto some unknown nodes. For example, the rating node. If you drop a rated song onto the unknown node under rating, it does clear the rating on that song.
Well, that is inconsistent if it works differently for the Unknown node in different tree branches.
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: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by ZvezdanD »

toof4st wrote:What I would like to be able to do is pin some nodes to a playlist
You cannot do that with this add-on. You could position Magic nodes only as children of the several built-in nodes listed in the Position combo box like Library, Artist, Web Radio and so on. However, you could create Magic node that would be a child of the Playlists node and you could use MN filter to specify that that node contains only tracks from some existing playlist. By the way, playlists created with Magic Nodes behaves the same as any regular MM playlist, so you could add/remove tracks to them as usual - such playlists would keep those modifications until you apply the Refresh Magic Node option from the context menu or if you modify the corresponding Magic Nodes mask. So, here is one example:

Code: Select all

Magic playlist|Child of:Playlists|Position:Child|Filter:<Playlist> = 'my_wyfe's_playlist'\<Artist>\<Album>
If you want nested playlists, you could use Group option as usual:

Code: Select all

<Group|Name:My playlists>\Magic playlist|Child of:Playlists|Position:Child|Filter:<Playlist> = 'my_wyfe's_playlist'\<Artist>\<Album>
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
willyvds
Posts: 439
Joined: Tue Feb 24, 2009 3:30 pm

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by willyvds »

toof4st,
if I understand correctly, this is for updating the sync list for an ipod?
You can also use the MM built-in function for that: extra/synchronize device/configure device, and select the desired device. Then you can select albums and playlists.
The device does not have to be connected to use this function. Next time you connect the device, the new configuration is used.
Regards, Willy
fizzjob
Posts: 417
Joined: Fri Mar 30, 2007 12:37 pm

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by fizzjob »

ZvezdanD wrote:
toof4st wrote:What I would like to be able to do is pin some nodes to a playlist
You cannot do that with this add-on. You could position Magic nodes only as children of the several built-in nodes listed in the Position combo box like Library, Artist, Web Radio and so on. However, you could create Magic node that would be a child of the Playlists node and you could use MN filter to specify that that node contains only tracks from some existing playlist. By the way, playlists created with Magic Nodes behaves the same as any regular MM playlist, so you could add/remove tracks to them as usual - such playlists would keep those modifications until you apply the Refresh Magic Node option from the context menu or if you modify the corresponding Magic Nodes mask. So, here is one example:

Code: Select all

Magic playlist|Child of:Playlists|Position:Child|Filter:<Playlist> = 'my_wyfe's_playlist'\<Artist>\<Album>
If you want nested playlists, you could use Group option as usual:

Code: Select all

<Group|Name:My playlists>\Magic playlist|Child of:Playlists|Position:Child|Filter:<Playlist> = 'my_wyfe's_playlist'\<Artist>\<Album>
I'm actually seeing a bit of odd behavior when making a Magic Node a child of Playlists.

Code: Select all

Duck And Cover|Filter:<Artist> <> <Original artist> and <Artist> <> '' and <Folder>) not Like 'd:\Christmas%'<Title|Sort order:Random|Show nodes:no>
When that's a child of Magic Nodes, there are 2272 files that come up. As a child of Playlists, it only has 178 entries. I must admit, I'm a little confused
Image
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by ZvezdanD »

fizzjob wrote:I'm actually seeing a bit of odd behavior when making a Magic Node a child of Playlists.

Code: Select all

Duck And Cover|Filter:<Artist> <> <Original artist> and <Artist> <> '' and <Folder>) not Like 'd:\Christmas%'<Title|Sort order:Random|Show nodes:no>
When that's a child of Magic Nodes, there are 2272 files that come up. As a child of Playlists, it only has 178 entries. I must admit, I'm a little confused
That mask is not correct, but it works fine when I fix it, not matter where the node is positioned. What version of the add-on have you installed? Could you send me your database file, so I could try to reproduce the problem?

By the way, the filters with multi-item fields are especially tricky ones, as you could see from the masks in the Filter Examples folder. For example, you should not compare multi-item field (Artist) with non-multi-item field (Original Artist). Also, you should not test if they are empty comparing them with empty string (''). Instead of that you should use <Multi ...> variants, i.e. <Multi Artist> <> <Original Artist> And <Multi Artist> <> '', or you could use their SQL equivalent, e.g. Songs.Artist <> <Original Artist> And Songs.Artist <> ''.
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
fizzjob
Posts: 417
Joined: Fri Mar 30, 2007 12:37 pm

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by fizzjob »

Is there a better method of checking for an empty string? Should I be looking for "is null" instead?

Also, I'm using MN 4.2, with MM 4.0.0.1399. I sent you a PM with a link to my database.

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

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by ZvezdanD »

fizzjob wrote:Is there a better method of checking for an empty string? Should I be looking for "is null" instead?
The mentioned method with <Multi Artist> <> '' is the best, it is simplest and probably fastest (since its query tests less records then <Artist> <> ''). For example, let say that I have only one track in the database where Artist = "David Bowie;Queen". That Artist field is actually the MM Artist field, but in MN it is one record with <Multi Artist> = "David Bowie;Queen" and two records with <Artist> = "David Bowie" and <Artist> = "Queen".

You cannot use <Artist> IS NULL condition because the corresponding queries in MN never return <Artist> as null. Magic Nodes uses INNER JOIN with multi-item fields, for example here is the query for selected node with Filter:<Artist> IS NULL:

Code: Select all

SELECT * FROM Songs WHERE Songs.ID IN (SELECT Songs.ID FROM Songs, ArtistsSongs AS AArtistsSongs, Artists AS SongArtists WHERE (SongArtists.Artist IS NULL) AND Songs.ID = AArtistsSongs.IDSong AND AArtistsSongs.IDArtist = SongArtists.ID AND (AArtistsSongs.PersonType = 1 OR AArtistsSongs.PersonType IS NULL))
By the way, in SQLite "FROM Songs, AArtistsSongs WHERE Songs.ID = AArtistsSongs.IDSong" is same as "FROM Songs INNER JOIN AArtistsSongs ON Songs.ID = AArtistsSongs.IDSong".

You see, such query with INNER JOIN never returns records where SongArtists.Artist IS NULL. That condition could be used only with LEFT JOIN query, for example:

Code: Select all

SELECT * FROM Songs WHERE Songs.ID IN (SELECT Songs.ID FROM Songs LEFT JOIN ArtistsSongs AS AArtistsSongs ON Songs.ID = AArtistsSongs.IDSong LEFT JOIN Artists AS SongArtists ON AArtistsSongs.IDArtist = SongArtists.ID AND (AArtistsSongs.PersonType = 1 OR AArtistsSongs.PersonType IS NULL) WHERE (SongArtists.Artist IS NULL))
However, LEFT JOINs are horribly slower then INNER JOINs in SQLite used in MM3, so I decided not to use them. It seems that the speed of LEFT JOINs is drastically improved in the new SQLite used in MM4, but I don't want to change anything regarding to that because of the compatibility. I have implemented another way to display empty (unknown) values for multi-item fields anyway.
fizzjob wrote:I sent you a PM with a link to my database.
Thanks for the database. However, even with it I am getting the correct results with your mask with the same number of tracks (2272), not matter where the node is positioned (inside of the Magic Nodes folder, inside of the Playlists folder...). Here is the fixed mask with the node in the Playlist folder:

Code: Select all

Duck And Cover|Child of:Playlists|Position:Child|Filter:<Artist> <> <Original artist> and <Artist> <> '' and <Folder> not Like 'd:\Christmas%'\<Title|Sort order:Random|Show nodes:no>
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
fizzjob
Posts: 417
Joined: Fri Mar 30, 2007 12:37 pm

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by fizzjob »

Hmm. I'm still getting the same situation, with more results in Magic Nodes than in the Playlist node.
Image
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Magic Nodes 4.2 w/ 380 masks & real GUI (2011-07-01)[MM2

Post by ZvezdanD »

fizzjob wrote:Hmm. I'm still getting the same situation, with more results in Magic Nodes than in the Playlist node.
I don't have any idea why this is happening to you. Maybe you could send me your MediaMonkey.ini file as well...
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