INTERACT FORUM

Please login or register.

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

Author Topic: Views/Expressions help needed  (Read 1929 times)

Aimhere

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 57
  • These are not the droids you're looking for.
Views/Expressions help needed
« on: November 05, 2017, 11:56:52 pm »

Hi,

I'm trying to create custom views for some of my video files, both in Standard and Theater Views. I need help with the expressions to display them the way I'd like.

A little background: Most of the movies in this section of my library are "monolithic" files (e.g. one file per movie, filename contains the title), BUT, a few were broken down into scenes/chapters when encoded (each is in a sub-folder named after the movie, containing the scenes/chapters as individual files). All movies are further grouped into parent folders based on 3-letter groupings of the first character of the title, e.g. "ABC", "DEF", GHI", etc. The folder structure looks kind of like this:

     Video\
        Full Movies\
           ABC\
              Movie Title [with scenes]\
                  Scene 1.mp4
                  Scene 2.mp4
                  Scene 3.mp4
              Movie Title [with scenes]\
                  Scene 1.mp4
                  Scene 2.mp4
                  Scene 3.mp4
              Movie Title.mp4    \
              Movie Title.mp4      monolithic files
              Movie Title.mp4    /
            DEF\
            GHI\
            etc.

I figured out a category expression that will make MC list all the movies by "Title", using the filename for the "title" if it is a monolithic file, OR the containing folder if it is broken into scenes:

Code: [Select]
If(IsEqual(FileFolder([Filename], 2), Full Movies, 1),
  FileFolder([Filename], 0),
  Filename()

Basically, if the part of the filepath 3 levels above the file (counting from 0 for the immediate parent) is "Full Movies", then it must be a single scene, and the displayed name will be the parent folder name. Otherwise, the file is monolithic and the displayed name will be the filename.

This much works... When I select the custom view, MC lists all movies by title, whether they are monolithic or scene-based.

Now, I would like to further GROUP the resulting list, either alphabetically by first character of the title, or semi-alphabetically by "ABC", "DEF", GHI", etc. Trouble is, MC doesn't allow grouping by both expression AND first-character at the same time (it can only do the latter on library fields, not expression results). So I need to somehow "wrap" my expression inside something that will group it the way I want.

If this can't be done, the only alternative I can see would be to tag all of my movies with "proper" Name fields in the library. But I have thousands of files, and "Get Movie & TV Info" and "Fill Properties from Filename" wouldn't be much help for these particular movies.

Any ideas?

Aimhere
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9143
Re: Views/Expressions help needed
« Reply #1 on: November 06, 2017, 10:23:30 am »

Simplest way I can think of right now without further complicating your expression, is to take your expression and create a library field from it.

"Tools > Options > Library & Folders > Manage Library Fields"

Click the 'add field' button.
Name the field.
Choose "Calculated Data" (near the bottom)
Paste your expression in there and 'Ok' your way out.

Now, when you add this new field to your view, you should have grouping options available to you.

If you don't want to do that, you'll need to wrap the whole expression in a "Left()" function...
https://wiki.jriver.com/index.php/String_Manipulation_Functions#Left

-marko

Aimhere

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 57
  • These are not the droids you're looking for.
Re: Views/Expressions help needed
« Reply #2 on: November 20, 2017, 10:10:32 am »

Thanks. That comes much closer to what I had in mind. :)
Logged
Pages: [1]   Go Up