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

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 »

aprzybylo wrote:Regarding collections I don't think I agree and I have simple example to illustrate. I develop magic node...
As I said, it is not a problem with the implementation of the collections, but with specific masks, in this case your magic node that you develop.

Here is some simple example in pseudo-code:
- Condition of <Collection 1> is <Decade of Album> = 70

- Algorithm 1 used in Magic Nodes:
Filter: (<Count of all albums by some artist> >= 3) AND <Collection 1>

- Algorithm 2 that you need to implement using Filter qualifier:
Filter: <Count of all albums belonging to <Collection 1> by some artist> >= 3

Here is another example in pseudo-code:
- Condition of <Collection 1> is <Track# is defined>

- Algorithm 1 used in Magic Nodes:
Filter: (<Album is complete if number of tracks is = max(track#)>) AND <Collection 1>

- Algorithm 2:
Filter: (<Album is complete if number of tracks belonging to <Collection 1> is = max(track#)>

Implementation of the first algorithm is simple, it just needs to add "AND <collection condition>" to the Filter. However, the second algorithm could contains unlimited number of different implementations depending of the Filter expression or the used Collection and because of that it cannot be implemented in the script. Anyway, what if some user explicitly wants to get the result of the first algorithm? So, you have the opportunity to implement the second algorithm using the Filter qualifier and I don't see a problem with that.
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
aprzybylo
Posts: 301
Joined: Tue Aug 21, 2007 2:58 pm
Location: Ottawa, Canada
Contact:

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

Post by aprzybylo »

Thank you very much, could you help me then a little on concrete example:

Songs.IDAlbum IN (SELECT IDAlbum FROM Songs GROUP BY IDAlbum HAVING Count(TrackNumber) <> Max(CAST(TrackNumber AS integer)) AND Count(TrackNumber) > 1 AND Max(CAST(TrackNumber AS integer)) > 0)

this is my filter based on your incomplete album magic node. I basicaly check 3 things
1) number of tracks is equal to maximum track#
2) I have at least 2 tracks
3) at least one track# is set (personally I don't set track# if I don't have whole album but only few songs from it)

where in that filter I have to put the restriction that I should only query songs fom Collection <Albums>
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 »

aprzybylo wrote:where in that filter I have to put the restriction that I should only query songs fom Collection <Albums>
Well, it depends of the collection's SQL expression. You could see that expression if you create a simple mask with that collection selected and if you have turned on the "Allow editing of SQL queries:" and "when select a field node" options in the Options dialog box - after you select that node you would get the new dialog box with WHERE part of the SQL expression of that collection.

I don't know what is your Collection <Albums>, but I suppose that the mentioned SQL part should be placed in your code after WHERE:
Songs.IDAlbum IN (SELECT IDAlbum FROM Songs WHERE ... GROUP BY IDAlbum HAVING Count(TrackNumber) <> Max(CAST(TrackNumber AS integer)) AND Count(TrackNumber) > 1 AND Max(CAST(TrackNumber AS integer)) > 0)

By the way, you should have = instead of <> in Count(TrackNumber) <> Max(CAST(TrackNumber AS integer)) if you want 1) number of tracks is equal to maximum track#. In that case the third condition in your HAVING expression is not necessary - if previous two ones are satisfied then the third one is satisfied as well. I think that you should also write Count(*) instead of Count(TrackNumber) if some of your tracks don't have assigned track#.
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
aprzybylo
Posts: 301
Joined: Tue Aug 21, 2007 2:58 pm
Location: Ottawa, Canada
Contact:

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

Post by aprzybylo »

Thanks a lot. I managed to make it work.

Now I try to figure out how ratings work. If I remember correctly the rating is stored ad 20 if 1*, 40 if 2*. Etc. then if not rated the field is 0 if bomb the field is -1 or something. If so how the script does to ignore not ranked songs and not to treat them as 0 ranked. Unless the rating is done differently it has to be explicit conversion or something.
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 »

aprzybylo wrote:if not rated the field is 0 if bomb the field is -1 or something.
Inversely - if track is not rated the field is -1, if bomb the field is 0.

If you want to change algorithm for statistical/sorting values in the script, you should know that the SortStatText function is used for their calculation. You should replace lines 4410-4411:

Code: Select all

                SortStatText = Replace(sMNCond, sMNField, "CASE WHEN " _
                        & sMinCond & " THEN NULL ELSE " & sSQLCond & " END")
with:

Code: Select all

                If UCase(sMNField) = "RATING" Then
                    SortStatText = Replace(sMNCond, sMNField, "CASE WHEN " _
                            & sMinCond & " THEN 0 ELSE " & sSQLCond & " END")
                Else
                    SortStatText = Replace(sMNCond, sMNField, "CASE WHEN " _
                            & sMinCond & " THEN NULL ELSE " & sSQLCond & " END")
                End If                     
If you want that kind of calculation only with Avg function, but not with Sum/Max/Min, then you should write:

Code: Select all

                If UCase(sMNCond) = "AVG(RATING)" Then
                    ...
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
aprzybylo
Posts: 301
Joined: Tue Aug 21, 2007 2:58 pm
Location: Ottawa, Canada
Contact:

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

Post by aprzybylo »

worked great, thank you
thefaceman
Posts: 367
Joined: Sun Aug 28, 2005 10:43 pm

REQ: Magic Node searches

Post by thefaceman »

Magic Nodes is AMAZING... THANKS (or groan as you have now allowed me to pass a LOT of time cleaning up my database of songs....LOL). I have about 70000+ files so it has helped greatly.

I have a few questions about a few of the presets.

1. A few of the presets I would not use, but when I click on them to 'delete' them, it still seems to 'perform' the search. And some of them take a LONG time on 70000 files. Is there any way I can delete a preset without it 'loading'?

2. What is 'albums - artists with mixed first and last name order (by aff)?

3. What is 'Albums with name different from last (rightmost)'?

I have examined all of the presets and there are a few 'searches' that I have not been able to determine how to create

Here are the following 'searches' that I cannot seem to figure out how to create.

How to search for
- Starts with A (space) or The (space)
- Double Spaces
- commas or dashes (Without spaces)
- title ends with a specific character (ie 2 or n' )
- commas within a # value (1,000,000)
- how to search a single value (ie V or II) not as 'part' of a value, either within or at the end of a title string
- Artists with multiple Ands in the Artist string

If any of these has already been answered let me know what I should have used for a 'search string in mm forum' so I can learn what 'keywords' I needed to know.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: REQ: Magic Node searches

Post by ZvezdanD »

thefaceman wrote:1. A few of the presets I would not use, but when I click on them to 'delete' them, it still seems to 'perform' the search. And some of them take a LONG time on 70000 files. Is there any way I can delete a preset without it 'loading'?
a) open Edit / Magic Nodes Settings dialog box, select mask from the Caption combo box and click on the Delete button, or
b) open Edit / Magic Nodes Export/Import dialog box, select mask(s) that you want to remove and click on the Del button.
2. What is 'albums - artists with mixed first and last name order (by aff)?
Honestly, I cannot remember. Why don't you try it by yourself? Or you could Search this thread for Aff's posts, I have copied it from there. I suppose it displays albums where Artist has swapped fist and last names.
3. What is 'Albums with name different from last (rightmost)'?
The full name of that mask is "Albums with name different from last (rightmost) Folder". If you have a folder hierarchy like Genre\Artist\Album then the last folder of the Path is (should be) equal to the Album name, otherwise it would be displayed with that mask.
How to search for
- Starts with A (space) or The (space)
You know that you should use the Magic Nodes Settings dialog box to create new masks, right?
- click on the New button;
- type name of the mask/node in the Caption combo box;
- choose wanted field from the second Filter combo box;
- choose begins with from the third Filter combo box;
- type "A " (without quotes) in the forth Filter combo box;
- click on the Add button next to the forth combo box;
- click on the end of the Filter string in the text box next below;
- choose OR from the first Filter combo box;
- type "The " (without quotes) in the forth Filter combo box;
- click on the Add button next to the forth combo box (your Filter should be now e.g. <Artist> Like 'A %' OR <Artist> Like 'The %');
- click on the Add button at the bottom of the dialog box.
- Double Spaces
You know that you could enter a complete mask in the Mask text box of the Magic Nodes Settings dialog box, right? I already gave you a solution at http://www.mediamonkey.com/forum/viewto ... 09#p317909 (e.g. Filter:<Artist> Like '% %')
- commas or dashes (Without spaces)
Similar as the previous suggestion, but you should choose contains from the third Filter combo box and type wanted string in the forth combo box.
- title ends with a specific character (ie 2 or n' )
Similar as the previous suggestion, but you should choose ends with from the third Filter combo box and type wanted string in the forth combo box. I already gave you a solution at http://www.mediamonkey.com/forum/viewto ... 09#p317909 (e.g. <Title> Like '%' || 'enter_a_specific_character_here')
- commas within a # value (1,000,000)
The RegExp Find & Replace add-on is much better for such things:
Find what: \d+(?:(,)\d{3})+
Regular expression 1: checked
If you want to replace commas in numbers with points:
Replace with: Replace("$&", ",", ".")
VBScript expression: checked
- how to search a single value (ie V or II) not as 'part' of a value, either within or at the end of a title string
I don't understand that.
- Artists with multiple Ands in the Artist string
I already gave you a solution at http://www.mediamonkey.com/forum/viewto ... 09#p317909 (e.g. UpperW(<Artist>) GLOB '* AND * AND *')
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
eepman
Posts: 45
Joined: Sun Aug 02, 2009 2:45 pm
Location: basement
Contact:

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

Post by eepman »

ZvezdanD wrote:
eepman wrote:I've been having an issue using the latest MN with MM 4.

In Added Statistics->Date Added->By Album Artist->Date->Unknown or in any other unknown nodes I see two of every file until i change sorting by clicking one of the column headers.

Do you know of anything that would cause this or is this a known issue?
I just tried and it works fine. Maybe your database is corrupted. You could try with the Optimize database option from the Maintain Library dialog box, just make its backup before that. If it is still happening you could upload the database file to some file service, so I could try to reproduce that issue with your database by myself.
Sorry I didn't get back to you sooner: DB Here: http://dl.dropbox.com/u/7953706/MM.DB
radium.io -- build software fearlessly
thefaceman
Posts: 367
Joined: Sun Aug 28, 2005 10:43 pm

REQ: New queries

Post by thefaceman »

Please let me know if my requests are getting too much. I am creating a 'lessons learned' post for 'newbies' and will share all of my newly created queries soon. I have a few more queries that I cannot figure out with Magic Nodes (or maybe Reg Exp)

1. My newest 'problem' is finding duplicates with the same Artist values but with 'swapped' positions within the Artist field
Example

Ella Fitzgerald And Louis Armstrong vs. Louis Armstron And Ella Fitzgerald.

2. Finding all of the artists with commonly misspelled or variations on words
Example

Color vs Colour or Don't vs Do Not

3. How to find the string n' (n with a single quote mark)

The magic node script below has an error (note double quote at end is two single quotes)

Finding Title that 'ENDS' with a specific character|Filter:<Title> Like '%' || 'n''
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 »

eepman wrote:Sorry I didn't get back to you sooner: DB Here: http://dl.dropbox.com/u/7953706/MM.DB
It seems that this file is heavily broken. I am getting bunch of errors during start-up with it and because of that the program even don't load any of auto-scripts including Magic Nodes. Please, could you upload the tested and working database file and it would be nice if you pack it previously with Zip, 7z or Rar.
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: REQ: New queries

Post by ZvezdanD »

thefaceman wrote:1. My newest 'problem' is finding duplicates with the same Artist values but with 'swapped' positions within the Artist field
Example

Ella Fitzgerald And Louis Armstrong vs. Louis Armstron And Ella Fitzgerald.

Code: Select all

Artists with swapped names (Ella & Louis vs. Louis & Ella)|Filter:UpperW(SubStr(<Artist>, InStr(<Artist>, ' and ') + 5) || ' and ' || SubStr(<Artist>, 1, InStr(<Artist>, ' and ') - 1)) IN (SELECT UpperW(Artist) FROM Artists INNER JOIN ArtistsSongs ON ArtistsSongs.IDArtist = Artists.ID) OR SubStr(<Artist>, InStr(<Artist>, ' & ') + 3) || ' & ' || SubStr(<Artist>, 1, InStr(<Artist>, ' & ') - 1) IN (SELECT Artist FROM Artists INNER JOIN ArtistsSongs ON ArtistsSongs.IDArtist = Artists.ID)
2. Finding all of the artists with commonly misspelled or variations on words
Example

Color vs Colour or Don't vs Do Not

Code: Select all

Artists with commonly misspelled or variations on words|Filter:<Artist> Like '%Colour%' OR <Arists> Like '%Do Not%'
or customize RegExp preset "Fix common words (I'm, I'll, don't, won't, ain't, isn't, can't) in <Into Field>..."
3. How to find the string n' (n with a single quote mark)

The magic node script below has an error (note double quote at end is two single quotes)

Finding Title that 'ENDS' with a specific character|Filter:<Title> Like '%' || 'n''
The single quote is a character used to enclose strings in the SQL expressions. If you want to use it inside of such strings you need to escape it with the same character, e.g. instead of n' you should write n'' (that is two single quotes). So, your expression should contain three single quotes at its end.
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
Milquetoast
Posts: 9
Joined: Wed Oct 12, 2011 1:07 pm

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

Post by Milquetoast »

I'm trying to create a node that lists my collection like this: Album Artist [A-Z], Album (by Year), By Disc. All tracks in my library are formatted with the Disc Number like this: 1/1, 1/2, etc. What I have so far:

Code: Select all

Album Artist [A-Z], Album (by Year), By Disc|Child of:Library|MM filter:Music|Position:First child\<Album artist>\<Album|Sort by:Max(Year)|Statistic:Count(Tracks), Count(Disc number)>\<Disc number|Split by:/|Split Mode:String Part|Split part:1|Statistic:Count(Tracks)>
And it looks like this:
Image
Which is great, because it gets me very close to what I want. The final piece I need is that I would only like the album to be expandable if there is more than 1 disc present. That way I won't have to read through the text of each album or click on the arrow to see if it's a multi-disc set, I would just know immediately which ones are multi-disc based on the presence of the arrow.

Is there any way to do this?
MediaMonkey Gold user since 2005
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 »

Milquetoast wrote:The final piece I need is that I would only like the album to be expandable if there is more than 1 disc present.
You should take a look at the included "Genre, Artist, Album, Dics #" mask. Here is also the excerpt of the What is new section for the 3.0 version:
* Added: possibility to use Show if empty option/qualifier for all local nodes except the last (deepest) one, with the hidden plus sign for nodes without sub-nodes; especially useful when Unknown qualifier for the next level is set to No, e.g. <Album|Show if empty:Yes>\<Disc Number|Unknown: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
rrfpacker
Posts: 1065
Joined: Sat Jul 12, 2008 5:47 pm

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

Post by rrfpacker »

I have the following mask already in MN under Album Ratings. It's function is to find all albums rated 3 or better with at least 5 songs. It works fine where it is.

<Group|Name:Album Ratings|Show tracks:No>\Albums with weighted avg. track rating >= 3 stars and at least 5 rated tracks|Icon:Top level|Filter:Songs.IDAlbum In (SELECT IDAlbum FROM Songs WHERE Rating >= 0 GROUP BY IDAlbum HAVING Sum(SongLength * Rating) / Sum(SongLength) >= 60 AND Count(Rating) >= 5)\<Album|Sort by:Avg(Rating)|Statistic:Count(All)>

I'm trying to get this same thing under playlists so I can sync it. Everytime I try to do so, MM freezes. I've tried changing the position from a child of MN to a child of Playlists within the mask itself and by copying the mask and pasting it into a "New" magic node. It freezes while it is "filling" up the node.

Or, everything is created as it should be and when I click on one of the albums under the node, nothing happens. MM says it's reading tracks and no tracks show up.

Any help is appreciated.
Post Reply