INTERACT FORUM

Please login or register.

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

Author Topic: Request: New Search Language ~expand Modifier  (Read 3947 times)

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Request: New Search Language ~expand Modifier
« on: May 06, 2015, 01:37:47 am »

I'd like to ask for a new Search Language Modifier: ~expand=fields

This would function identically to the current ~a modifier, which expands the current selection to include all tracks from each album, except that you could choose which field to expand.  So, for example, the current ~a modifier would be equivalent to ~expand=[Album], but you could also do ~expand=[Series] or ~expand=[Artist] to expand the selection to all files from the same [Series] or [Artist] respectively.  Or, like ~limit, combinations thereof if desired.

I think, since you already have the ~a logic, it should be relatively simple to implement (I know, I know, I shouldn't guess about these things).  The new feature would be incredibly powerful, though, and would solve many long-standing View and search construction problems I have, which lead you down a "we need iterators" rabbit hole.

For example, one thing I've wanted to build for a long time is a Shows We're Currently Watching view, for Theater View.  This would automatically limit the results to:
* Any TV Show [Series] where [Last Played] of any episode of that series is within the last 8 weeks.
* All unwatched episodes of the resulting series

This is effectively impossible to do with the current capabilities of Media Center, because you'd need to iterate over [Last Played] for all episodes in a [Series] and then pick out a list of "Series items" (instead of just those individual files).  But the ~expand modifier would make this a thing of the past.  You could just make a "Currently Watching Series" Smartlist that does the Last Played math, and then expands to [Series].  Then, point your View at that Smartlist, and limit it to unwatched episodes.

I can think of all sorts of other uses.  For example, I'd like to make a "Favorite Artists" music view as well.  This would show not just individually favorited tracks, but all tracks by any artist that has at least one track with four or more stars.

You could use this any time you want to search your Library for "all files where other files by that same [Field] meet these conditions" kind of lookup.  You can't do that in Media Center currently, and it is a fairly major limitation.  This solution wouldn't meet all needs of this type completely cleanly (but using the "recursive smartlists" trick to re-filter, you really could do a lot with it), but I think it falls into the categories of:
* Using and expanding what we already have without requiring a major overhaul
* Solving a wide variety of use cases

So... What do you say?  Is that something you could add?
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: Request: New Search Language ~expand Modifier
« Reply #1 on: May 06, 2015, 08:37:47 am »

Sounds useful. +1
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Request: New Search Language ~expand Modifier
« Reply #2 on: May 06, 2015, 09:41:31 am »

+1
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10924
Re: Request: New Search Language ~expand Modifier
« Reply #3 on: May 06, 2015, 09:53:35 am »

This sounds useful enough. I should just check how ~a is implemented, and if a generalized form of that would be as trivial as glynor hopes!
Logged
~ nevcairiel
~ Author of LAV Filters

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42325
  • Shoes gone again!
Re: Request: New Search Language ~expand Modifier
« Reply #4 on: May 06, 2015, 10:10:52 am »

Beat you to the punch Hendrik.

Next build:
NEW: Smartlists take the ~expand keyword that takes a field name and expands to every genre, artist, etc. in the match.
Logged
Matt Ashland, JRiver Media Center

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Request: New Search Language ~expand Modifier
« Reply #5 on: May 06, 2015, 10:20:06 am »

You guys ROCK!!!

 :o :o ;D
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: Request: New Search Language ~expand Modifier
« Reply #6 on: May 06, 2015, 10:24:58 am »

Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Request: New Search Language ~expand Modifier
« Reply #7 on: May 06, 2015, 10:26:05 am »

You guys ROCK!!!

 :o :o ;D

It's true!  This one will make some fun smart lists
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: Request: New Search Language ~expand Modifier
« Reply #8 on: May 07, 2015, 05:10:24 am »

Ooh, always good to get new expression language support!

Does ~expand only work with defined fields?  Single fields only or multiple fields?  Subsets of fields? 

If not, I've taken this further with variables for those that might need such functionality:

http://yabb.jriver.com/interact/index.php?topic=90504.0



Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42325
  • Shoes gone again!
Re: Request: New Search Language ~expand Modifier
« Reply #9 on: May 07, 2015, 05:17:57 am »

Does ~expand only work with defined fields?  Single fields only or multiple fields?  Subsets of fields? 

The build is public now, so just give it a try.  Then follow-up here if you still have questions.
Logged
Matt Ashland, JRiver Media Center

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42325
  • Shoes gone again!
Re: Request: New Search Language ~expand Modifier
« Reply #10 on: May 07, 2015, 05:26:49 am »

Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up