INTERACT FORUM

Please login or register.

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

Author Topic: An expression to modify sorting of the library view  (Read 1969 times)

Bengi010

  • World Citizen
  • ***
  • Posts: 173
An expression to modify sorting of the library view
« on: May 27, 2012, 08:05:57 pm »

I'm working on organizing my movies in the standard library view (not theater view), and have run into a difficulty.  It may be that I'm going about this in the wrong way but I'll try to explain what I'm hoping to accomplish.  I want all my movies to be listed alphabetically, but movies in a series to be grouped together.

 I accomplished that by sorting by series first, which means I have to copy the movie name to the series field for every movie regardless of whether it has a sequel or not else they all just pile up under "Unassigned".  The drawback is that it creates extra work to get a movie to play.  Instead of just clicking a movie to play it, it opens up a new window listing all the movies in the series, even if it's only just one.  I've been living with this for some time and just gotten used to it.

Today I compounded the issue when I decided to move all the movies based on comics to a group called Marvel Comics, but wanted them to still be sorted within that category by series, within the Marvel Comics series.  So I created a custom field I called sub-series and that fixed that problem nicely.  The problem is that now to watch any other movie I have to navigate through series and sub-series views before a double click will play the movie.  (I realize that there is a "play" option when hovering the pointer over the movie in series view that neatly sidesteps the issue). 

To get to the point, I'm wondering if there's a way to use an expression so that if there is only one movie in a series, or sub-series, then it will skip opening those views and double clicking will simply play the movie.
Logged
Intel Core i-5 6600K, Asus Z170-A ATX Motherboard, Gigabyte GTX 970 4GB, 16 GB Corsair Vengeance Ram, Asus Xonar Essence STX,
                                          Be Quiet Dark Power Pro 10 1000w PSU, Lian-Li PC-B25F ATX Tower,
                                   Dell S2716DG G-Sync Monitor & AOC 2230 Monitor, Corsair Hydro H60 Cooler,
                                                                    Windows 10, JRiver MC 23

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: An expression to modify sorting of the library view
« Reply #1 on: May 27, 2012, 08:42:52 pm »

Which fields do you have to work with?  I assume Series, but what else ([Season], [Episode], [Name], etc.)?  If you can show a brief tree of how you want things, indicating those fields, that might help.  Ex:

Mad Men  [Series]
  - 1.1 Smoke Gets in Your Eyes  [Season].[Episode] [Name]
  - 1.2 Ladies Room
  ...

Breaking Bad
  - 1.1 ...
  - 1.2 ...

Others

In a categories view, you can create a category based on an expression that allows you to create a hierarchy as deep as you need, or place items at the root.
Logged
The opinions I express represent my own folly.

Bengi010

  • World Citizen
  • ***
  • Posts: 173
Re: An expression to modify sorting of the library view
« Reply #2 on: May 27, 2012, 09:03:23 pm »

I'm actually talking about movies, not TV Shows right now.  My TV is set up adequately.  I'll post some pictures of what I have and try to explain what I want.

Here is the first thing you see under Video > Movies



Then if you clicked on "Marvel Comics" you see this



Then if you clicked on "Blade" you see this




In this one instance it works great.  The problem is with every other movie I have 2 extra screens to navigate through.  Say I clicked Midnight in Paris instead.  I get this



Then this



Then I can double click the bottom image to play the movie.

What I want to do is for anything that has only one movie in the series bypass those two extra steps.  So that if I double click Midnight in Paris on that first screen it would play immediately. 

I was hoping there was someway to use an expression to say If there is only one movie in the series then play movie... But I'm not very good with expressions yet.

Logged
Intel Core i-5 6600K, Asus Z170-A ATX Motherboard, Gigabyte GTX 970 4GB, 16 GB Corsair Vengeance Ram, Asus Xonar Essence STX,
                                          Be Quiet Dark Power Pro 10 1000w PSU, Lian-Li PC-B25F ATX Tower,
                                   Dell S2716DG G-Sync Monitor & AOC 2230 Monitor, Corsair Hydro H60 Cooler,
                                                                    Windows 10, JRiver MC 23

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: An expression to modify sorting of the library view
« Reply #3 on: May 27, 2012, 09:14:34 pm »

The concept is the same, regardless of the Media Sub Type.

What I need to know is what field to use generally, but to switch on for drilling down (and I can't determine this from the screenshots).  For example, if you're using Name for the movie name (e.g. Blade, Blade II, Blade Trinity), then you can use something like [Group] or [Series] to act as the parent group, and you can use an expression such as :

  if(isempty([Group]),[Name],[Group]\[Name])&datatype=[list]

as a single category expression.  This will create a hierarchy, using Group (or change it to Series) as the parent grouping, and just Name if Group is empty.  This should give you the idea.
Logged
The opinions I express represent my own folly.

Bengi010

  • World Citizen
  • ***
  • Posts: 173
Re: An expression to modify sorting of the library view
« Reply #4 on: May 27, 2012, 09:19:57 pm »

Sorry, I'm using Name, Series and Sub-Series to create those groups.  Where do I write that expression you created?
Logged
Intel Core i-5 6600K, Asus Z170-A ATX Motherboard, Gigabyte GTX 970 4GB, 16 GB Corsair Vengeance Ram, Asus Xonar Essence STX,
                                          Be Quiet Dark Power Pro 10 1000w PSU, Lian-Li PC-B25F ATX Tower,
                                   Dell S2716DG G-Sync Monitor & AOC 2230 Monitor, Corsair Hydro H60 Cooler,
                                                                    Windows 10, JRiver MC 23

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: An expression to modify sorting of the library view
« Reply #5 on: May 27, 2012, 09:26:50 pm »

Customize your Categories view (or create a new one), and remove the categories listed under Show Categories In This Order.  Add a new category and set the Type as Expression.  Paste the expression, and give it a name.
Logged
The opinions I express represent my own folly.

Bengi010

  • World Citizen
  • ***
  • Posts: 173
Re: An expression to modify sorting of the library view
« Reply #6 on: May 27, 2012, 09:29:45 pm »

Thanks, got it.  Sort of... I'll keep playing with it and figure it out.  But could you give me a hint how working with three or more categories would look?  as in if sub-series is empty then series, if series is empty then name.
Logged
Intel Core i-5 6600K, Asus Z170-A ATX Motherboard, Gigabyte GTX 970 4GB, 16 GB Corsair Vengeance Ram, Asus Xonar Essence STX,
                                          Be Quiet Dark Power Pro 10 1000w PSU, Lian-Li PC-B25F ATX Tower,
                                   Dell S2716DG G-Sync Monitor & AOC 2230 Monitor, Corsair Hydro H60 Cooler,
                                                                    Windows 10, JRiver MC 23

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: An expression to modify sorting of the library view
« Reply #7 on: May 27, 2012, 09:42:51 pm »

In that case, use listbuild() to generate the hierachy for you:

   listbuild(1,\, [Series], [Sub-Series], [Name])&datatype=[list]

Order the fields as you want them - the above will place Series at the highest level (if it exists), followed by Sub-Series, followed by Name.  If these fields are empty, they are ignored, so you'll get a listing such as:

   Lord of War
   Love Actually
   Marvel Comics
       Blade
          Blade
          Blade II
          Blade Trinity
    Spiderman
         Spiderman
         ...
    Master and Commander...
    The Matrix
       ...
Logged
The opinions I express represent my own folly.

Bengi010

  • World Citizen
  • ***
  • Posts: 173
Re: An expression to modify sorting of the library view
« Reply #8 on: May 27, 2012, 09:50:07 pm »

That's awesome.  It's almost perfect.  I have one more request that I hope will be as easy.  The new list sorts everything alphabetically, but I would like movies within a series, like all the James Bond movies, to be sorted by date so that they are in sequential order.  How would I accomplish that?
Logged
Intel Core i-5 6600K, Asus Z170-A ATX Motherboard, Gigabyte GTX 970 4GB, 16 GB Corsair Vengeance Ram, Asus Xonar Essence STX,
                                          Be Quiet Dark Power Pro 10 1000w PSU, Lian-Li PC-B25F ATX Tower,
                                   Dell S2716DG G-Sync Monitor & AOC 2230 Monitor, Corsair Hydro H60 Cooler,
                                                                    Windows 10, JRiver MC 23

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: An expression to modify sorting of the library view
« Reply #9 on: May 27, 2012, 10:04:45 pm »

If you sort the expression category based on Date (via Customize View), then all items in that level of the category will sorted by Date, so you'll lose the alphabetical sorting at the top and mid-levels.  Probably this isn't what you want.

You can add the year to the beginning of the Name if is is part of a series.  This will force sorting by date, and it would look something like:

 Lord of War
   Love Actually
   Marvel Comics
       Blade
          1998 Blade
          2002 Blade II
          2004 Blade Trinity
    Spider-man
         2002 Spider-man
         ...
    Master and Commander...
    The Matrix
       ...

Would that be OK?
Logged
The opinions I express represent my own folly.

Bengi010

  • World Citizen
  • ***
  • Posts: 173
Re: An expression to modify sorting of the library view
« Reply #10 on: May 27, 2012, 10:12:04 pm »

It's not ideal, but it works well enough.  Thanks.  I'll play with this more tomorrow.  I appreciate the help.
Logged
Intel Core i-5 6600K, Asus Z170-A ATX Motherboard, Gigabyte GTX 970 4GB, 16 GB Corsair Vengeance Ram, Asus Xonar Essence STX,
                                          Be Quiet Dark Power Pro 10 1000w PSU, Lian-Li PC-B25F ATX Tower,
                                   Dell S2716DG G-Sync Monitor & AOC 2230 Monitor, Corsair Hydro H60 Cooler,
                                                                    Windows 10, JRiver MC 23

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: An expression to modify sorting of the library view
« Reply #11 on: May 27, 2012, 10:13:29 pm »

Sure.  Just in case you want to try it:

   listbuild(1,\, [Series], [Sub-Series], if(!isempty([Series]),[Date]/ ,)[Name])&datatype=[list]

By the way, the File list can be sorted independently, via the pull down at the top of the File list.  This would allow your categories in alphabetic order, but the list of file thumbnails in Date order.
Logged
The opinions I express represent my own folly.

Bengi010

  • World Citizen
  • ***
  • Posts: 173
Re: An expression to modify sorting of the library view
« Reply #12 on: May 28, 2012, 03:01:27 pm »

I've been playing with this a little this afternoon.  I like the expression you gave me, I just switched [Date] to [Year] to clean up the look a little.  That worked great and I like being able to immediately see the year a film was made. 

Right now I'm trying to modify the expression to use in my Recently imported view (shows everything imported in the last 4 days, both movies and tv shows).  The problem I run into here is that [Year] obviously won't work with a TV series, but the using [Date] just looks messy.

I'm wondering if there is a way to hide the date without ignoring it.  In other words if the first 11 characters were invisible to me but still used to sort then if would look and work perfectly.  Is there a way to do that?
Logged
Intel Core i-5 6600K, Asus Z170-A ATX Motherboard, Gigabyte GTX 970 4GB, 16 GB Corsair Vengeance Ram, Asus Xonar Essence STX,
                                          Be Quiet Dark Power Pro 10 1000w PSU, Lian-Li PC-B25F ATX Tower,
                                   Dell S2716DG G-Sync Monitor & AOC 2230 Monitor, Corsair Hydro H60 Cooler,
                                                                    Windows 10, JRiver MC 23

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: An expression to modify sorting of the library view
« Reply #13 on: May 28, 2012, 08:02:50 pm »

No inviso-mode that I know of.

You could format the Date as Year for movies, and Year-Month-Day for others.
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up