INTERACT FORUM

More => Old Versions => JRiver Media Center 18 for Windows => Topic started by: sirganty on April 29, 2013, 04:36:28 am

Title: Anyone able to help writing an expression?
Post by: sirganty on April 29, 2013, 04:36:28 am
Expressions rule
Period

But I'm trying to work out if something is possible.

I would like to write an expression for MCWS search that returns 4 random files from the 12 most recently imported albums excluding the 1 most recently imported album.

I can do the first bit easily enough, but I'm struggling to see if its possible to exclude the top result?

Any pointers?

Thanks
Title: Re: Anyone able to help writing an expression?
Post by: sirganty on April 29, 2013, 04:41:48 am
sorry, should have included where I'd got to:

so this returns 4 random (1 per album) files from the last 12 imported albums
[Media Type]=[Audio] [Album Type]=[Single artist (complete)] ~limit=-1,1,[Album] ~sort=[Date Imported]-d ~n=12 ~sort=Random ~n=4

just can't see if its possible to exclude the first result following the ~sort=[Date Imported]-d ~n=12

I thought about giving that set a ~seq and then filtering on [Sequence]>1 but there doesn't seem to be a way to add a filter later in the expression, or am I wrong?
I've tried just a filter ~[Sequence]=>1 and using a ~mix=11,100%,{[Sequence]=>1} but none yield any results.
Title: Re: Anyone able to help writing an expression?
Post by: MrC on April 29, 2013, 11:02:35 am
You'd want to select one track from each of the most recent albums, sorted by date imported descending, select 12 tracks, sort by Date Imported ascending, then select only 11 tracks, then expand albums to include all tracks, sort randomly, and then select 4 tracks:

~limit=-1,1,[Album],[Album Artist (auto)] ~sort=[Date Imported]-d ~n=12 ~sort=[Date Imported] ~n=11 ~a ~sort=Random ~n=4

btw. pedantically, this would be a search query (as opposed to an expression).
Title: Re: Anyone able to help writing an expression?
Post by: sirganty on April 29, 2013, 11:09:23 am
You sir, are a genius!

filter, limit, sort, limit, sort opposite, limit, sort random, limit again!
why didn't I think of that!

thanks MrC
Title: Re: Anyone able to help writing an expression?
Post by: MrC on April 29, 2013, 11:13:35 am
Who don't love a good hepin' of flattery on a Monday morning?