INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Smartlist Construction?  (Read 1203 times)

eve

  • Citizen of the Universe
  • *****
  • Posts: 689
Smartlist Construction?
« on: October 11, 2022, 02:03:42 pm »

I have a sort of specific question about the expression language and smartlist construction. I'm looking to duplicate the logic of the 'ShowTime' option in a smartlist. In other words, I want to generate a list of random items matching tags with those random items being in a specific order based upon said tags. So for example, I'd like to search 'Pre-Show' for 'Trailer' and get 2 of those, and then get 1 'Pre-Show' matching 'Short', and 1 'Pre-Show' matching 'Feature Presentation' and then assemble these in that order.

Currently, I do a bit of Node Red and just return the various searches in Pre-Show to build a MCWS command that inserts each file key into the play queue in the order I've chosen. I feel as though this is a little inefficient, web request wise. So I'm curious if there's a way to construct a smartlist like ShowTime kind of does? Then each time I want this, instead of 'building' a queue, I could just load the smartlist which would be populated with random items, in the order of my choosing.

I love the pre-show thing but I need to trigger it remotely from another interface (and then append my actual movie file to the end of the play queue). It all works but it's a little obtuse.
Logged

eve

  • Citizen of the Universe
  • *****
  • Posts: 689
Re: Smartlist Construction?
« Reply #1 on: October 12, 2022, 06:01:45 pm »

Anyone? I hate to bump but this seems like a pretty simple question a dev / support could answer.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Smartlist Construction?
« Reply #2 on: October 12, 2022, 06:32:09 pm »

Can you imagine that this could be a single MCWS call if you gave it a few variables?  We might be able to add something.
Logged

eve

  • Citizen of the Universe
  • *****
  • Posts: 689
Re: Smartlist Construction?
« Reply #3 on: October 12, 2022, 09:23:11 pm »

Can you imagine that this could be a single MCWS call if you gave it a few variables?  We might be able to add something.
Hmmm. I don't see why not. I thought this could be maybe accomplished with a smartlist but an MCWS call that lets you run multiple searches, and return the results in the order entered is a great idea, for far more than just this specific situation Jim!


If I'm communicating this poorly, hopefully the following explains a bit better.


At the moment I do something along the lines of

http://--:52199/MCWS/v1/Files/Search?Action=serialize&ActiveFile=-1&Zone=-1&ZoneType=ID&Limit=1&Query=[Pre-Show]=[Coming-Soon] ~n=1
http://--:52199/MCWS/v1/Files/Search?Action=serialize&ActiveFile=-1&Zone=-1&ZoneType=ID&Limit=1&Query=[Pre-Show]=[Trailer-Grab-Bag] ~n=2
http://--:52199/MCWS/v1/Files/Search?Action=serialize&ActiveFile=-1&Zone=-1&ZoneType=ID&Limit=1&Query=[Pre-Show]=[Personal-Logo] ~n=1
http://--:52199/MCWS/v1/Files/Search?Action=serialize&ActiveFile=-1&Zone=-1&ZoneType=ID&Limit=1&Query=[Pre-Show]=[Feature-Presentation] ~n=1
etc

This gives me output like "2;2;-1;70485;70283" for each one. These file keys of course change each time the command is run, as it's supposed to pick a random file which matches the search.

I then pass these keys along to JRiver using an MCWS command like,

http://--:52199/MCWS/v1/Playback/PlayByKey?Key={{payload.coming-soon}},{{payload.trailer1}},{{payload.trailer2}},{{payload.personal-logo}},{{payload.feature-presentation}}&Zone=-1&ZoneType=ID

Where each {{payload.xyz}} is a file key that lets me control the order in which they're added to the currently playing.

So if this were to be simplified into a single MCWS command perhaps,

 http://--:52199/MCWS/v1/Playback/BuildSequence?Zone=-1&ZoneType=ID&Sequence=[Pre-Show]=[Coming-Soon],[Pre-Show]=[Trailer]~n=2,[Pre-Show]=[Personal-Logo],[Pre-Show]=[Feature-Presentation]

Each comma separated value is a search, and returns a media file chosen randomly which satisfies the query (or however many files, as designated by ~n=x), this order should be enforced when adding to the currently playing queue.

Besides my specific use case, I have a feeling this wouldn't be entirely useless for other situations either and actually could be quite interesting for music playlists.




Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Smartlist Construction?
« Reply #4 on: October 12, 2022, 10:33:59 pm »

It's a little bit like a programming language.
Logged

eve

  • Citizen of the Universe
  • *****
  • Posts: 689
Re: Smartlist Construction?
« Reply #5 on: October 12, 2022, 11:51:35 pm »

It's a little bit like a programming language.
A little bit!
Also a fantastic pun since we're 'programming' the queue here.

It's really not that terribly complex in terms of automating. However, if it were simplified into a single MCWS command, such as this theoretical "BuildSequence" one, I think people may actually find a use for it outside of "Before The Movie" type queuing. It could provide more granular control for launching interesting 'random' playlists with a specific flow / pattern. For example a workout / running playlist that starts out with a handful of of 80s hits before launching into higher energy electronic music and then winding down with some recent adult contemporary for the walk home. All of these these 'sections' or 'movements' are easy to translate into JRiver search expressions (and I say this as someone who is still baffled by much of the JRiver search / expression language), but as far as I know, there's no way to chain those 'separate' searches together in a specific order.

I frankly got the idea from ShowTime's little config options. I realized it wouldn't be terribly hard to duplicate that sort of logic on my own if I asked JRiver for files matching searches and then compiled them into a Play command in the correct order.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: Smartlist Construction?
« Reply #6 on: October 13, 2022, 07:05:28 am »

So is the goal to play by search?  So a PlayBySearch command?

It could take a list of searches, pipe-delimited.  And a list of limits.

PlayBySearch?Search=[Genre]=[Hard Rock]|[Genre]=[Slow Rock]&Limit=2|2

Or are you trying to accomplish something else?

Thanks for keeping us on our toes!
Logged
Matt Ashland, JRiver Media Center

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2618
Re: Smartlist Construction?
« Reply #7 on: October 13, 2022, 10:12:47 am »

Assuming you have a field called "Pre-Show" with the values you mention, this playlist should work:

Code: [Select]
[Media Type]=[Video] ~sort=Random ~mix=4,2,{[Pre-Show]=Trailer},1,{[Pre-Show]=Short},1,{[Pre-Show]="Feature Presentation"} ~sort=[Duration]
The ~sort=[Duration] should cause the trailers to play first and the Feature last, but it may sort incorrectly if you have very long Trailers/Shorts. To fix that, you can create an expression field called [Show Order] with this expression:
Code: [Select]
ifcase([Pre-Show],8,Trailer,1,Short,2,Feature,3)
And then use it for the final ~Sort:
Code: [Select]
[Media Type]=[Video] ~sort=Random ~mix=4,2,{[Pre-Show]=Trailer},1,{[Pre-Show]=Short},1,{[Pre-Show]=Feature} ~sort=[Show Order]
Logged

eve

  • Citizen of the Universe
  • *****
  • Posts: 689
Re: Smartlist Construction?
« Reply #8 on: October 13, 2022, 01:32:27 pm »

So is the goal to play by search?  So a PlayBySearch command?

It could take a list of searches, pipe-delimited.  And a list of limits.

PlayBySearch?Search=[Genre]=[Hard Rock]|[Genre]=[Slow Rock]&Limit=2|2

Or are you trying to accomplish something else?

Thanks for keeping us on our toes!

Matt,

That's pretty much what I'm looking for. Just to be clear with this theoretical example, I'd get a play queue with 2 hard rock songs, followed by 2 soft rock songs, in that order?
If so, you nailed it. The point is to have each pipe-delimited search return it's own set of files, and then place them in the queue, respecting the order that the searches were entered.
Thanks so much for taking this into consideration and spending the time to listen to users.

Assuming you have a field called "Pre-Show" with the values you mention, this playlist should work:

Code: [Select]
[Media Type]=[Video] ~sort=Random ~mix=4,2,{[Pre-Show]=Trailer},1,{[Pre-Show]=Short},1,{[Pre-Show]="Feature Presentation"} ~sort=[Duration]
The ~sort=[Duration] should cause the trailers to play first and the Feature last, but it may sort incorrectly if you have very long Trailers/Shorts. To fix that, you can create an expression field called [Show Order] with this expression:
Code: [Select]
ifcase([Pre-Show],8,Trailer,1,Short,2,Feature,3)
And then use it for the final ~Sort:
Code: [Select]
[Media Type]=[Video] ~sort=Random ~mix=4,2,{[Pre-Show]=Trailer},1,{[Pre-Show]=Short},1,{[Pre-Show]=Feature} ~sort=[Show Order]

Zybex,

That's not bad, though "Feature Presentation" in my case is a short logo (I have quite a large collection of these, they're typically referred to as 'snipes' in the industry). I handle the actual Movie as a second command that appends the movie file to the end of my play queue, AFTER all of these pre-show items. It's somewhat more efficient this way as I have to run some commands in the background to actually 'find' the movie, sort through all the versions of said movie I have, and pick the most 'ideal' one.

The thing is, with what I'm trying to accomplish, the order is important and thus, sorting by duration isn't exactly ideal.
The sort by [Show Order] expression is a smart way to work around that, however it's my understanding that then I'm stuck with this specific order in a way.
With the approach I've taken, I can specify what the 'flow' is going to be.
Logged
Pages: [1]   Go Up