Magic Nodes 1.3b (IS OUTDATED SEE NOTE IN FIRST POST)

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

rovingcowboy
Posts: 14162
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy »

that's going to be there all the time just incase you get a computer error some place in your system that messes with the tags.

or you make a mistake and don't catch it. or some song you got from a p 2 p is a virus and messes with your song tags of your library.

the unknow folder will show any thing that is not correctly formated for that node.

if nothing is in there then your songs are good.

you are trying to do away with a safty feature. 8)
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
stutes
Posts: 101
Joined: Mon May 12, 2003 9:06 pm
Contact:

Post by stutes »

Mediamonkey has an "Artist Properties" field which is accessible by right-clicking on an artist node and selecting properties. Can Magic Nodes use the info find in this field to create a Magic Node?
Kingmob
Posts: 5
Joined: Fri Aug 11, 2006 12:48 pm
Location: Rotterdam, The Netherlands
Contact:

Post by Kingmob »

First off: hello, since i'm new here :)
Thanks for this awesome script which greatly enhances mediamonkey. Tbh i think it should be standard in there ;).

Now my (silly) question, how do i do an 'is not equal to' statement? != does not seem to be accepted. For example i have:

Code: Select all

Christmas|filter:genre='Christmas'\<album>\<artist>
which works fine, but

Code: Select all

Artist|filter:genre!='Christmas'\<artist|trim:1>\<album>
Gives me all kinds of errors.

Sadly you cannot search inside topics in phpbb as far as i know, otherwise i would've probably found it, but i couldn't find it in the help files.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Post by Bex »

Hi Kingmob and welcome!

The correct syntax is <>

Like this:

Code: Select all

Artist|filter:genre<>'Christmas'\<artist|trim:1>\<album>
And there's no problem to search within topics in phpbb. Just try it and see that it works.

/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Kingmob
Posts: 5
Joined: Fri Aug 11, 2006 12:48 pm
Location: Rotterdam, The Netherlands
Contact:

Post by Kingmob »

ok, cheers!
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Post by Bex »

stutes wrote:Mediamonkey has an "Artist Properties" field which is accessible by right-clicking on an artist node and selecting properties. Can Magic Nodes use the info find in this field to create a Magic Node?
No not yet. It has to be added to the script.


/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
stutes
Posts: 101
Joined: Mon May 12, 2003 9:06 pm
Contact:

Post by stutes »

No not yet. It has to be added to the script.
Thanks for the reply Bex.

Personally I'd love to see the addition... I've been wanting to create playlists based on artist "tags" (properties) instead of track tags for a LONG time.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Post by Bex »

ZvezdanD wrote:
Pablo wrote:Thanks Bex!!! The next release will contain your improvement :D
Hi folks,

I am sorry because I'm late, but I started to play with MM & MN just recently. Actually, I discovered a different solution for the mentioned problem. It works not only with "The", but also with any of prefixes defined in the Options dialog box ("A", "An", "Le", ...). Also, with my corrections there is not a problem with artists like "Therese" and similar.

There was also a problem with prefixes and grouping with trim options, which I've removed. If you don't know what I'm talking about, please try following:

"Album artist (by year)\<album artist|trim:1>\<album artist>\<album|sort by:max(year)>"

You'll get A, B, C... on the first level, and authors on the second, but authors with "The" prefix will be all inside of "T" node. Now, with my correction this will not happening anymore.

Also, I've removed a nasty behavior with dialog box which doesn't displayed OK and Cancel button on my computer. (You could see in this thread, there was some folks with the same problem.)

Pablo, if you want, I can send you the modified .vbs file, to take it in consideration.
ZvezdanD!
This is indeed a very good enhancement to MN which deserves attention. Pablo seems to be busy and havent been on the forums for quite a while now.

Can you please post your modified script here so other could use it as well?

/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
ZvezdanD
Posts: 3112
Joined: Thu Jun 08, 2006 7:40 pm

Post by ZvezdanD »

Bex wrote:
ZvezdanD!
This is indeed a very good enhancement to MN which deserves attention. Pablo seems to be busy and havent been on the forums for quite a while now.

Can you please post your modified script here so other could use it as well?

/Bex
Hi Bex,

Thank you for your interesting about my modification of MN. There is many lines of code which I added/modified, so I sent whole script to Pablo immediately after my first post in this forum. Pablo said to me that he is currently busy, but: "in a couple of weeks at most I'll resume working on the script and I'll add your changes."

Well, I can post here my modified script, but I am not sure if it is right to Pablo, especially because he is modified last version of script also. Anyway, I can give you a little guide to my modifications.

First, less modification is inside of SkinnedInputBox function, because I had a strange dialog box (Create Magic Node or Edit Magic Node) without OK and Cancel buttons. Well, this buttons exists, but they are truncated, outside of visible area of form. I think that main reason for this behavior is place of line:

Code: Select all

     Form.SavePositionName = "Remember position"
I moved that line after all created controls on that form in mentioned function, and after that everything is OK.

Next modifications are inside of FillCustomNode subroutine, because of "The" and similar prefixes. Here is a part of this subroutine:

Code: Select all

    ' ZvezdanD: Start of first added lines
    If IgnoreArticleDict.Exists(FldTxt) Then
        Dim aIgnore, sTmp, i
        If SDB.IniFile.BoolValue("Options", "IgnoreTHEs") Then
            aIgnore = Split(SDB.IniFile.StringValue("Options", "IgnoreTHEStrings"), ",")
        Else
            aIgnore = Articles
        End If
        OrderField = ""
        For i = 0 To UBound(aIgnore)
            sTmp = UCase(Trim(aIgnore(i)))
            OrderField = OrderField & "Ucase(Left(" & Field & ", " & Len(sTmp) + 1 & ")) = '" & sTmp & " ', " & Len(sTmp) + 2 & ", "
        Next
        If Len(OrderField) = 0 Then
            OrderField = Field
        Else
            OrderField = "Mid(" & Field & ", Switch(" & OrderField & "True, 1))"
        End If
        If trimValue > 0 Then Field = OrderField
    End If
    ' ZvezdanD: End of first modification

   If Not trimField Then
                ' Do nothing
   ElseIf trimValue > 0 Then
        Field = "Left(" & Field & "," & trimValue & ")"
   ElseIf trimValue < 0 Then
                Field = "Right(" & Field & "," & (-trimValue) & ")"
   ElseIf leftOfValue <> "" Then
                Field = "Left(" & Field & ", InStr(" & Field & ", '" & leftOfValue & "'))"
   ElseIf rightOfValue <> "" Then
                Field = "Right(" & Field & ", Len(" & Field & ")-InStr(" & Field & ", '" & rightOfValue & "'))"
   End If
    
   ' Set several parameters according to whether an index field has been defined
   
   If IdFieldDict.Exists(FldTxt) And Not trimField Then
        IdField = IdFieldDict.item(FldTxt)
        ContentIndex = 1
   Else
        IdField = Field
        ContentIndex = 0
   End If
  
   ' Deal with the sort field specified by the user
        
   SortCondition = getQualifierValue(curLevelMask, "sort by", "", False)
   
   'Determine how to order type
   
    ' ZvezdanD: Start of second modification
    If SortCondition <> "" Then
        OrderType = otOrderByAggregate
        OrderField = " IIF(Min(" & getSQLSortField(SortCondition) & ")<0, -1, " & getSQLSortFieldCondition(SortCondition) & ") "
    ElseIf IgnoreArticleDict.Exists(FldTxt) Then
        OrderType = otOrderByIgnoreArticle
        If trimValue > 0 Then OrderField = Field
    Else
        OrderType = otOrderByField
        OrderField = Field
    End If
    ' ZvezdanD: End of modificatons

   ORDER_BY_Clause = " ORDER BY " & OrderField & " " & getQualifierValue(curLevelMask, "sort order", "ASC", False) _
                                                & Cond(OrderType <> otOrderByField, ", " & Field, "")

   'Deal with known/unknown fields
As you can see, there are two possibilities for reading prefixes: first is from MM ini file (there is IgnoreTHEs key which corresponds to the option in Options dialog box), and second is on the beginning from same MN script. I did like that because I don't know from which MM version that IgnoreTHEs option exists.

Because of that, I changed subscript from 1 to 0 in next lines on script begin:

Code: Select all

     Dim Articles(0)
     Articles(0) = "The"
I am sorry, but English is not my mother language. Maybe this is all confusing, but I think you should wait to Pablo next release of his script.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Post by Bex »

Hi ZvezdanD!

Thanks for your reply. I'm not a scripter but I'll see what I can do with your modifications. I'll guess some copy & paste can make it to work.

Thanks!
/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Pablo (not logged in)

Post by Pablo (not logged in) »

Hi folks, this is Pablo. I'm in the middle of graduation and moving overseas so I haven't been able to work on MM for a while. Zvezdan is more than welcome to post his modified code. I have other improvements (many sent by other people), so I definitely plan to resume work at some point, but it won't happen for another month or so, so meanwhile having the Zvezdan-modified version around will be the best.

Cheers,

Pablo
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Post by Bex »

Hi Pablo!
Looking forward to your return.
Please be quick, we miss you! :D

/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Post by Bex »

Hi folks,

Here are some examples on how to use "SQL filter:" to select songs to your nodes, based on when they are played:


These are the codes for periods which stretches from a date until now:

Code: Select all

Played Today|SQL filter:Datevalue(LastTimePlayed)=date()\<artist>

Played This Week|SQL filter:Format(LastTimePlayed,'yyyyww')=Format(date(),'yyyyww'))\<artist>

Played This Month|SQL filter:Format(LastTimePlayed,'yyyymm')=Format(date(),'yyyymm'))\<artist>

Played This Year|SQL filter:Format(LastTimePlayed,'yyyy')=Format(date(),'yyyy'))\<artist>

Played Last 7 Days|SQL filter: Datevalue(LastTimePlayed)>(date()-7)\<artist>
And here are the codes for periods which have a starting and ending point back in time:

Code: Select all

Played Yesterday|SQL filter:songs.id in (select idsong from played where Datevalue(playdate)=date()-1)\<artist>

Played Last Week|SQL filter:songs.id in (select idsong from played where Format(PlayDate,'yyyyww')=Format(date()-7,'yyyyww'))\<artist>

Played Last Month|SQL filter:songs.id in (select idsong from played where Format(PlayDate,'yyyymm')=Format(DateAdd('m',-1,date()),'yyyymm'))\<artist>

Played Last Year|SQL filter:songs.id in (select idsong from played where Format(PlayDate,'yyyy')=Format(DateAdd('yyyy',-1,date()),'yyyymm'))\<artist>
In the first case, which is faster, we can use the LastTimePlayed field in the songs table.
In the second case we must use the PlayDate field in the Played table otherwise it won't display all tracks played in that period.

Enjoy!
/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
ZvezdanD
Posts: 3112
Joined: Thu Jun 08, 2006 7:40 pm

Post by ZvezdanD »

Pablo (not logged in) wrote:Hi folks, this is Pablo. I'm in the middle of graduation and moving overseas so I haven't been able to work on MM for a while. Zvezdan is more than welcome to post his modified code. I have other improvements (many sent by other people), so I definitely plan to resume work at some point, but it won't happen for another month or so, so meanwhile having the Zvezdan-modified version around will be the best.

Cheers,

Pablo
OK, folks. For all of you who want to try my modifications, I suppose it is easier that you get full .vbs script. But, I am wondering now if it is any way to attach a file in this forum. Should I copy/paste full .vbs file inside of post? This is not a problem to me, but it is very long and can occupies whole page in this thread. So, please let me know what should I do with it.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Post by Bex »

Its perfectly OK just to copy/paste the full .vbs into this thread!

Thanks!
/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Locked