Page 1 of 2

Need Magic Nodes arguments 4 multi-album, unknown, orig year

Posted: Sat Dec 15, 2007 9:28 am
by doubleij
Hello,

I'm new to Magic Nodes and I'm having difficulty getting some of the masks to work. I'm currently using the 1.4x beta version, but I've also had the same problems with the 1.3x official release.

I am able to create basic nodes without problems, but I don't know how to create three different sub-arguments that I need for several nodes.

1. I need an argument or script that organizes albums by original year or by year if original year is blank. I am not sure how to write an argument that tells the script to search original year field first and then go to year if original year is blank.

2. I need an argument that will hide or remove the unknown folders in all my magic nodes. I use unknown:no as a local qualifier, but it doesn't seem to work at all. Is this a bug in the program?

3. I need a filter that will identify multi-album artists. I have no idea how to create this. SQL?

I am trying to create four different nodes in total. One is a tree node that is organized by artist and then by album by year of original release (thus, I need the original year where applicable, but also the normal year field if necessary).

One is composer (I will use multi-album artist here).

One is a year tree with albums released in each year (original release here again).

And one is a straight multi-album artist node.


Thanks in advance. I'm new to magic nodes and I just can't seem to crack these arguments after several hours trying. I've looked through the tutorial and as many examples as I can find.

Another

Posted: Sat Dec 15, 2007 7:53 pm
by ZvezdanD
1. I am not sure that I know exactly what you want. If you want to display Original Year on the same node level as Year, it is not possible. Instead, you could have Original Year as one node and Year as sub-node:

Code: Select all

Albums by Original Year and Year\<Original Year>\<Year>\<Album>
You could also create two nodes, one for Original Year and another for Year:

Code: Select all

Albums by Original Year|filter:Original Year <> ''\<Original Year>\<Album>

Albums by Year|filter:Original Year = ''\<Year>\<Album>
AFAIK, Original Year field is not intended for storing original release date of the same album, but for same song of one author released by different artists. Therefore there exists Original Artist, Original Title and Original Lyricist fields.

2. There is a bug in the script which is already discovered. If you don't want to wait for the next version of the script, you could try to remove it by yourself: open MagicNodes-1.4.3.1.VBS file in Notepad, go to line 1594 and replace "Unkown" with "Unknown".

3. If you want to display artists who have more than one album:

Code: Select all

Artists with more then one album|SQL filter:Songs.Artist IN (SELECT Songs.Artist FROM Songs, ArtistsSongs, Artists WHERE Songs.ID = ArtistsSongs.IDSong AND ArtistsSongs.IDArtist = Artists.ID AND Songs.IDAlbum > 0 AND ArtistsSongs.PersonType = 1 GROUP BY Artists.ID HAVING Count(DISTINCT Songs.IDAlbum) > 1)\<Artist>\<Album>

Posted: Sat Dec 15, 2007 9:01 pm
by Guest
Thanks for the quick reply!

Your fix for unknown seems fairly simple, so I will go ahead and try to do that myself. Thanks very much for the SQL for multi-album artists as well.

I think I'm still confused by original year/year, so let me see if I understand what you're saying.

At this point, it's not possible to tell the script to use one field as a default value in a particular node but then go to a different field if the original field is blank for a particular track.

Is that correct? If so, that's definitely on my wishlist for future updates to Magic Nodes.

I guess my other option is to run a script that transfers the year field to original year where OY is blank, so that OY always has content. Do you know of a script that does a selective field replace like that? It would need to avoid replacing fields where OY is already filled with a value.

BTW, good to know about the original intention of Original Year. I couldn't figure out exactly what it was for, but my current use seems to work pretty well. I suppose album release original year would go into a custom field normally?

Thanks again!

Posted: Sat Dec 15, 2007 9:23 pm
by doubleij
Sorry, that was me above. I'm still getting the hang of posting on the forum! :)

Posted: Sun Dec 16, 2007 12:45 am
by doubleij
I fixed the unknown bug you mentioned with no problems this afternoon. However, your artists with more than one album script had several errors when I tried to run the script.

I recorded the errors carefully. Here they are in the order they appeared.

There was a problem querying the database.

Error # -2147418113 – SongsDB-SDBDBIterator
Field 'count_unknown' not found. line 1579, Col. 35

Error completing DIB section. The operation completed successfully. Aborting...


There was a problem querying the database.

Error # -2147418113 – SongsDB-SDBDBIterator
Line 1798 Col. 8

Error happened during script execution: SQL_ERROR


Any ideas? Thanks. I will try to find a field complete script this afternoon as I mentioned in my previous post. If you know of a good one, let me know.

Posted: Sun Dec 16, 2007 2:33 am
by ZvezdanD
Anonymous wrote:At this point, it's not possible to tell the script to use one field as a default value in a particular node but then go to a different field if the original field is blank for a particular track.

Is that correct? If so, that's definitely on my wishlist for future updates to Magic Nodes.
Yes, this is correct. Next version of the script may have this possibility (by-product of another feature), but I could not give any promise about that in this moment. I'll see what I can do.
Anonymous wrote:I guess my other option is to run a script that transfers the year field to original year where OY is blank, so that OY always has content. Do you know of a script that does a selective field replace like that? It would need to avoid replacing fields where OY is already filled with a value.
I didn't tried any of the scripts which could do mass-replacing of the fields, but I think you should try the ExtractFields script. I am not sure if it have any built-in conditional replacing, but maybe it could replace only those data which exists in the source field. Please make a backup of the database and then try mentioned script with following steps: 1. OriginalYear -> Custom1, 2. Year -> OriginalYear, 3. Custom1 -> OriginalYear. If you don't get what you want, you should post a request to its forum thread: http://www.mediamonkey.com/forum/viewtopic.php?t=10566
doubleij wrote:your artists with more than one album script had several errors when I tried to run the script.
Which version of MM do you have? This mask is for MM3.

Posted: Sun Dec 16, 2007 10:24 pm
by doubleij
Thanks!

I tried extract fields last night. It worked pretty well. The script does not have a conditional replace yet, but I was able to transfer all the relevant year data to custom 2, which I renamed Original Album Release Year. That way, Original Year will be used for recording date (as you said was intended). Unfortunately, I can't seem to use custom 2 with the sort by qualifier. It says the mask is invalid.

I use: |sort by:first(original album release year)


Right now, I'm using MM2.5x. I've waiting for the official release of MM3, since I'm a gold user and want to upgrade that way. But if I won't have any problems updating MM3 late beta to the official release then I'll be happy to get MM3 now. What do you think?

Posted: Mon Dec 17, 2007 3:03 pm
by ZvezdanD
doubleij wrote:Unfortunately, I can't seem to use custom 2 with the sort by qualifier. It says the mask is invalid.
This is now possible with 1.5.0.1 version of the script. Please, take a look on it.
doubleij wrote:Right now, I'm using MM2.5x.
Here is a same mask for MM2, but it is drastically slower (~40 seconds instead of 1 second for MM3):

Code: Select all

Artists with more then one album|SQL filter:Songs.IDArtist IN (SELECT CountArtist FROM (SELECT DISTINCT IDArtist AS CountArtist, IDAlbum FROM Songs WHERE IDAlbum > 0) GROUP BY CountArtist HAVING Count(CountArtist) > 1)\<Artist>\<Album>
You could also use Statistic:Count(Items) introduced with the new version of the script to display number of albums for each artist.

Maybe I need to mention that this mask displays artists which have tracks on two or more albums, but there is not testing conditions for complete albums in this filter. If you want such thing, the mask would be more complicated and much slower.
doubleij wrote:if I won't have any problems updating MM3 late beta to the official release then I'll be happy to get MM3 now. What do you think?
Well, I am not sure, but I think there shouldn't be any problem for upgrade. You could also use both versions (2.x and 3) on the same computer without a problem.

Posted: Mon Dec 17, 2007 9:57 pm
by doubleij
Thanks, I will give the new Magic Nodes script a try today. I installed MM3 RC1 and the multi-album artist mask encountered no errors. I'm fine with the mask displaying incomplete albums at this point. The mask did display a few artists that actually only have songs on one album, so I'm wondering if there's a way I can remove these artists manually.

I will put in 1.5x and see if I can get the sort by fields to work well.

Posted: Mon Dec 17, 2007 11:02 pm
by doubleij
Update:

MagicNodes 1.5 works fine. Great job!

I found a possible bug when writing a composer by genre mask. The mask worked great except that all the artists that are in the "blues" genre were listed as "unknown" in the genre node. Classical, Jazz and all other artists were listed under their genres without problems.

Here's the mask I used:
Composer by Genre|child of:artist|icon:top level|SQL filter:Songs.SongPath LIKE '%FLAC%'\<genre>\<composer>\<artist>\<album>

Any ideas?

Posted: Tue Dec 18, 2007 12:18 am
by doubleij
Update 2

The composer mask above works fine in my MM2.5 installation running MN 1.4

Posted: Tue Dec 18, 2007 5:12 am
by ZvezdanD
doubleij wrote:The composer mask above works fine in my MM2.5 installation running MN 1.4
Could you please try a next version of the script with both MM2 and MM3 and let me know if it works better? Thanks.

http://solair.eunet.yu/~zvezdand/MagicN ... 5.0.1a.vbs

Posted: Tue Dec 18, 2007 7:35 am
by doubleij
Actually, I already ran MagicNodes 1.5 in MM3. That's where I ran into the problem with the composer mask not recognizing composers in the Blues genre. I just replaced 1.4 with 1.5 for my MM2.5 installation. I ran the composer by genre mask and I had no problems with the Blues genre.

Does this mean that the script is ok, but MM3 has a bug related to blues? If so, where and how do I report that?

I also ran the Magic Nodes 1.5 and tried the sort by for a custom field and got nowhere in either MM2.5 or MM3. I was using this mask:

Artist (By Custom 2)|child of:artist|icon:top level\<Artist|unknown:no>\<Album|sort by: first(Custom 2)>

So maybe support for custom fields isn't quite there yet.

MM3 looks nice, and I'm pleased to see that they are taking Magic Node ideas and using them (Album Artist, Artist & Album Artist, etc.). Good work!

Posted: Tue Dec 18, 2007 10:56 am
by ZvezdanD
Did you tried to download version (1.5.0.1a) which link I posted? It has some change in connection with this what is happened to you. I am not sure, but this could solve a problem. I don't believe this problem has a connection with specific genre, maybe there is another problem with the script and the Artist field.

There is a problem with the mask you mentioned because it has one many blank character between sort by: and first. You should also know that First and Last aggregate functions are not supported by SQLite and MM3 and you should avoid their usage, instead you could use Min and Max.

Posted: Wed Dec 19, 2007 1:22 am
by doubleij
Thanks ZvezdanD,

I got MN 1.5.0.1a yesterday. Today, I ran two scripts on this Magic Nodes in MM2 and MM3. Here is what I found.

I ran this mask:
Composer by Genre|child of:artist|icon:top level|SQL filter:Songs.SongPath LIKE '%FLAC%'\<genre|unknown:no>\<composer>\<artist|unknown:no>\<album>

In MM2 the above script worked fine. In MM3 I got exactly the same error with the Blues genre that I described several posts ago.


I also ran this mask (where Original Album Release Year = Custom 2):
Artist (By Original Album Release Year)|child of:artist|icon:top level\<Artist|unknown:no>\<Album|sort by:max(Original Album Release Year)|unknown:no>

As you can see, I tried to correct this mask as you suggested in your last post. The mask created correctly this time, but when I attempted to expand any artist node in this magic node I received three error messages. This happened in both MM2 and MM3. The error messages were quite long and were related to script execution and database query. The error number in both MM2 and MM3 was 2147418113.

I am running MM3RC5 (3.0.1.1120) and MM2.5.5.998.

I took screenshots of all the errors. If these would be helpful to you, let me know and I can email them.