Author Topic: Genre selection does not perform to full functionality of Media Monkey  (Read 6199 times)

0 Members and 4 Guests are viewing this topic.

SexGecko

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
I noticed that when asking vox to play a certain genre of music in MM, it would only play songs where the genre EXACTLY matched what was asked for.

This makes sense, however, when selecting genres within media monkey, it allows you to specify multiple genres for a song using semi-colons (i.e. "Jazz;Blues")

I realize that this is an added benefit in MM, but is there a way to utilize this? (besides simplifying all my songs to have only one genre)

TL;DR: When I ask for "Jazz", I won't get any "Jazz;Blues" in my playlist. When I SELECT "Jazz" in media monkey, I get it all.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Genre selection does not perform to full functionality of Media Monkey
« Reply #1 on: December 19, 2011, 06:56:32 PM »
yes, you can make the request more flexible, though you may get more than you asked for.

the default command is like this:

action:  MM.LoadBySQL
param:  Genre Like '{1}' order by random() limit 200

you can change the param to look like this:  Genre Like '%{1}%' order by random() limit 200

The % symbols act like wildcards, so if you ask for the genre 'folk' you will get anything where the genre string contains the string 'folk'.

this means you'll get songs with the genre field that looks like this: folk; singer-songwriter

but also if it looks like this: folk-rock  (which you may not want)

now there is probably a fancy sql where clause that we could use that would account for the ; but I haven't figured it out.

I hope this is close enough.

SexGecko

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Genre selection does not perform to full functionality of Media Monkey
« Reply #2 on: December 19, 2011, 07:11:54 PM »
This seems like a pretty good solution for the meantime,
you must have at least one song with ONLY a certain genre though (for example if you don't have any that are just "funk" it will return "funk;soul" or "funk:jazz" or whatever other combinations you might have and only play that combo, no big deal)

The only other issue I can think of is (like you mentioned) the redundancy factor (such as now when I ask for rock, it will play all light and progressive rock tracks I have too. Guess I'll change it to "Standard Rock").

Thanks for your help! prompt as always!

SexGecko

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Genre selection does not perform to full functionality of Media Monkey
« Reply #3 on: December 19, 2011, 07:32:42 PM »
I've tried changing
"Genre Like '{1}'  order by random() limit 200"
to
"Genre Like '{1};%'  order by random() limit 200"
and that works (as well as your original suggestion of %{1}%)

but I can't seem to get it working with the OR operator

for example:

"Genre Like '{1};%' OR Genre Like '%;{1};%' OR Genre Like '%;{1}' order by random() limit 200"

does not work, which would theoretically be a complete and robust solution (just about anyway) Any idea why I cant throw some 'OR's in there?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Genre selection does not perform to full functionality of Media Monkey
« Reply #4 on: December 19, 2011, 09:34:06 PM »
I don't know off hand.  I would have to play with it a bit.  You would think that the or operator would work.

You could try putting each or in brackets  (e.g.  (a=b) or (c=d).  Though I doubt it will make any difference.

MM uses SQLite but their version of SQLite is not an exact recreation of the official SQLite.  They have their own version of it.  It is also possible that combining Or and Like does not work for some reason.  I will let you know if I figure anything out.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Genre selection does not perform to full functionality of Media Monkey
« Reply #5 on: December 19, 2011, 10:18:56 PM »
try this one!  It might be a bit slower but it seems to work.

Songs.ID IN (SELECT IDSong FROM GenresSongs WHERE GenresSongs.IDGenre IN ( SELECT Genres.IDGenre FROM Genres WHERE Genres.GenreName like ('{1}')))  order by random() limit 200

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Genre selection does not perform to full functionality of Media Monkey
« Reply #6 on: December 21, 2011, 09:05:13 AM »
Songs.ID IN (SELECT IDSong FROM GenresSongs WHERE GenresSongs.IDGenre IN ( SELECT Genres.IDGenre FROM Genres WHERE Genres.GenreName like ('{1}')))  order by random() limit 200

did you try this?

SexGecko

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Genre selection does not perform to full functionality of Media Monkey
« Reply #7 on: December 21, 2011, 08:07:44 PM »
Sorry I've been MIA, trying your suggestions and I'll let you know how my tests come up.

EDIT: Good show man! This works perfectly!

You still need at least one song in your library of only one genre (one for each type) to register them as actual genres, but this is a different issue altogether (and one I don't care about at all)

Thanks for all your help, this really is exactly what I was looking for!

 :)

EDIT: Might be worthwhile to throw this out in vanilla from now on? Or if it seems to heavy maybe just a sticky on this part of the forum, again, supreme work!
« Last Edit: December 21, 2011, 08:18:41 PM by SexGecko »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Genre selection does not perform to full functionality of Media Monkey
« Reply #8 on: December 21, 2011, 09:05:52 PM »
You still need at least one song in your library of only one genre (one for each type) to register them as actual genres,...

I don't really know what you mean about this.  What do you mean by "register them as actual genres" ?  Are you still talking about this action or are you talking about GenXML scanning mediamonkey, or something else?  Is this a VC issue, or a MediaMonkey issue?

I don't think I have any genres in my library that appear only in songs that have multiple genres.

Thanks for reporting your success.  I'll probably put this in as the default genre command for the MM config. :)

SexGecko

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Genre selection does not perform to full functionality of Media Monkey
« Reply #9 on: December 22, 2011, 06:27:04 PM »
Sorry, I mean "have them stored as actual genres in the XML".

For example if I have 8 tracks in my library, and the genres on ALL of them are "Irish;Celtic" (i.e. I have NO songs with JUST "Irish" or JUST "Celtic" as their genres) then when the XML is generated I will have "Irish;Celtic" available as a genre but not "Irish" or "Celtc" individually since they never existed as standalone text to assimilate in the first place.

Basically all this means is the engine to generate XML for media monkey counts semicolons as actual Genre text and not genre delimiters
(which I suppose could make sense if someone wanted their genre to be "Spell;d L;ke Punk R;ck" or something weird like that, however THIS WOULD NOT FLY in mediamonkey itself, so that argument is irrelevent)

One thing you should note though however is that the select statement you have managed to come up with above (thanks again for that) will not return any results if the genre you're asking for has semicolons in it, which means you'd have to adjust how the "Gen XML" script treats semi colons.

EDIT: I clarified this a bit.
« Last Edit: December 22, 2011, 06:42:23 PM by SexGecko »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Genre selection does not perform to full functionality of Media Monkey
« Reply #10 on: December 22, 2011, 06:38:00 PM »
I need to update the code to split genres on semi colons.  It should not be too hard, if I can remember to get around to it.