Page 10 of 170

Posted: Sun Sep 16, 2007 3:28 pm
by ZvezdanD
Last public version of Magic Nodes doesn't support multiple arguments of sort by qualifier and I doubt it will ever support a mathematical expression as a multiplication, except if it is inside of SQL filter.

Currently, you have two possibility. First, you could try to use SQL filter qualifier to emulate first query:

Code: Select all

Most Played by Time|icon:top level|SQL filter:Exists (SELECT TOP 150 Nationality, Sum(PlayCounter) FROM Songs GROUP BY Nationality HAVING Count(*) > 1 ORDER BY Sum(PlayCounter) DESC)\<Nationality|sort by:avg(length)|sort order:desc|all:no|unknown:no|top:100|min tracks:40>
Second, you could try statistic qualifier in combination with sort by:

Code: Select all

Most Played by Time|icon:top level\<Nationality|sort by:avg(length)|sort order:desc|all:no|unknown:no|top:100|min tracks:40|statistic:sum(played)>
In the last example, you could try to rotate arguments of sort by and statistic qualifiers.

Code: Select all

Most Played by Time|icon:top level\<Nationality|sort by:sum(played)|sort order:desc|all:no|unknown:no|top:150|min tracks:1|statistic:avg(length)>

Posted: Sun Sep 16, 2007 6:10 pm
by declan
Thanks, the second of the two is a neat work around. I can quickly put that information onto a spreadsheet.

Posted: Thu Sep 27, 2007 10:25 am
by Big_Berny
Hi ZvezdanD,
two bugs I found:
-Sorting is different from MediaMonkey's one. Underlines come after numbers, but in MM they come before. I just noticed that because I use __Compilations and __Soundtracks.
-<artist> shows the Composer. I have to use <album artist> instead.

Nice work btw! :)

Posted: Thu Sep 27, 2007 12:48 pm
by ZvezdanD
Thanks for reporting this.

1. You are right, underscore is after numbers. This is a problem with MM3 because I was using NOCASE collation to get similar behavior as MS Jet in MM2. Other then that, SQLite by default only support BINARY collation. But now, I see that MM developers added IUNICODE collation which works as expected. So, if you don't want to wait for the next script version and want correct sorting with underscore, you should replace all COLLATE NOCASE to COLLATE IUNICODE inside of the script.

2. Are you sure about that? <Artist> is working correctly to me, and (I think) to many others. Could you post a MN mask which you typed?

BTW, with a last public version of the script, you cannot use Artist, Album artist, Composer, Lyricist and Conductor inside of the same SQL filter, e.g. Artist = 'aaa' And Composer = 'ccc'. I am not sure, but there is also a possibility that you cannot use mentioned persons on different levels of the same root node, e.g. My Node\<Artist>\<Composer>. This bug is removed in a new (non-published) version.

Posted: Thu Sep 27, 2007 6:37 pm
by Big_Berny
Hi,
1. Thanks a lot!
2. For example this one: "Interpret\<artist>\<album|sort by:max(year)|sort order:desc>"
I just saw that songs with composer are listed twice, under the artist (correct) and under the composer... Maybe it has something to do with this (see last post)?: http://www.mediamonkey.com/forum/viewtopic.php?t=21146

Posted: Fri Sep 28, 2007 7:22 am
by ZvezdanD
Yeah, you are right. As I said, this is a problem not only with Composers, but with any person whose name is stored in Artists table (Album artist, Lyricist and Conductor). This behavior is already resolved in a new version.

Posted: Fri Sep 28, 2007 10:20 am
by Big_Berny
Cool, thanks! :)

Posted: Mon Oct 08, 2007 8:23 am
by danhackley
I wonder if anyone can help me with the magicnode code needed to do the following:

I want a tree node called "compilations". Clicking on this will then open a list of genres by which compilations are grouped. Opening the genre then lists the compilation titles in alphabetical order. The year in brackets would also be nice.

E.g.

Genre
Album Artist
Artist
Compilations
---Ambient
---Be-bop
---Cha-cha
---Dance
---------A collection of dance classics (1995)
---------Best of techno (2003)
---------Crazy trance vol.3 (2001) etc


Any help much appreciated !!

Posted: Mon Oct 08, 2007 8:50 am
by Mizery_Made
If you use a common Album Artist for your compilations, then something like the following would work:

Code: Select all

Compilations|child of:album|SQL filter:artist='Various Artists'\<Album Artist>\<Genre>\<Album|statistic:max(year)>
If you use something other then "Various Artists" then you'd change that part. Kind of redundant to have the "<album artist>" in there, but when I tried removing it, I received a couple error messages... sooo.... *Shrugs*

Posted: Mon Oct 08, 2007 11:27 am
by ZvezdanD
This is not redundant to have <Album artist> subnode, because maybe someone wants such a display.

Here is a mask without Album artist subnode for MM2:

Code: Select all

Compilations|child of:album|SQL filter:Artists.Artist = 'Various Artists' AND Artists.ID = Albums.IDArtist AND Albums.ID = Songs.IDAlbum\<Genre>\<Album|statistic:max(year)>
Same for MM3:

Code: Select all

Compilations|child of:album|SQL filter:Artists.Artist = 'Various Artists' AND Songs.IDAlbum = ArtistsAlbums.IDAlbum AND ArtistsAlbums.IDArtist = Artists.ID\<Genre>\<Album|statistic:max(year)>
More sophisticated mask would use filtering of albums with more than one artist, instead of filtering with album artists, but this is another story.

Posted: Mon Oct 08, 2007 11:44 am
by Mizery_Made
I stated that it was redundant because it seems most people use one Album Artist for all of their compilations, usually "Various Artists" so having the <Album Artist> there simply gives you one node, you know? Doesn't matter though, since you got a different formula to accomplish it (even though I don't know what any of it does after the "Album.Artist = 'Various Artists'", Lol.)

Posted: Mon Oct 08, 2007 6:08 pm
by ZvezdanD
Well, "most" people doesn't mean "all" people. As I said, maybe someone wants such behavior.

Computer cannot read users mind. If you entered a SQL condition which contains the Album artist field, this not explicitly mean that you don't want to display this field as a subnode. You know, there are many situations with the Album artist field inside of the SQL filter where users exactly want to display this field as a subnode.

BTW, condition is not Album.Artist = '...', but Artists.Artist = '...'. All additional conditions after that is because same Artists table contains all person names (Artist, Album artist, Lyricist, ...).

Actually, in this case a mask for MM3 could be simpler. Instead of all conditions which I wrote, there is enough to write SQL filter: Songs.AlbumArtist = 'Various Artist'. However, the mask mentioned before is generally preferred because it takes in account tracks with multiple Album artists.

Posted: Tue Oct 23, 2007 2:29 pm
by danhackley
Thanks a lot for that code, ZvezdanD - your code seemed to work with my MM3. I now have a tree node arranging compilations by genre, then within that genre alphabetically with year in brackets.

The code was

Compilations|child of:album|SQL filter:Artists.Artist = 'Various Artists' AND Songs.IDAlbum = ArtistsAlbums.IDAlbum AND ArtistsAlbums.IDArtist = Artists.ID\<Genre>\<Album|statistic:max(year)>

One question: is it possible to have next to each genre in this view the number of tracks or (preferably) albums in brackets ?

Posted: Wed Oct 24, 2007 7:04 am
by ZvezdanD
danhackley wrote:is it possible to have next to each genre in this view the number of tracks
http://www.mediamonkey.com/forum/viewto ... 6695#96695
danhackley wrote: or (preferably) albums in brackets ?
http://www.mediamonkey.com/forum/viewto ... 371#102371

Posted: Wed Nov 07, 2007 5:32 pm
by nojac
I use this AlbumArtist node:

Code: Select all

Album Artist MN (##)|child of:Artist\<album artist|statistic:count(all)>\<album|sort by:max(year)|sort order:asc|statistic:count(all)>
Inspired by the MissingTracks script, can I modify my node to also display the max track number in addition to the track count?

I want a display like this: 1965 Help (12/14) if I have 12 of the 14 tracks. (Of course I will need the last track for the number to be correct)