INTERACT FORUM

Please login or register.

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

Author Topic: expression help for view scheme: how to extract tv show name from filenames?  (Read 1823 times)

lise

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 942

All my tv shows have this filename format:  Battlestar Galactica-(No Exit)-2009-02-13-0.wmv

I need a way to get that show name (x number of characters before the first hyphen) in a view scheme, without tagging, without filling in properties from filename, without doing anything. Basically I just want a way to display show titles from filenames so that I can sit in my chair and watch some shows, not sit in my chair and tag just so that I could find my shows.

I thought I could use an expression pane, but couldn't figure out how to transfer all characters that appear before the first hyphen into a list.  As far as I could tell, RemoveLeft and RemoveRight require a constant number of characters. Mine varies. My only constant is that the name ends with a hyphen.

I know I could use Fill Properties from Filename and probably get it all sorted out, but as I said, I don't want to tag, I want to watch! Now, if fill properties from filename was an expression of sorts that I could use in a pane or a field to display the show names on the fly, that would be perfect. Can it be used that way?

I already have a working solution, if anyone is interested, but it's very tedious to set up and maintain:

TV Show Pane

Battlestar Galactica
Kitchen Nightmares
New Yankee Workshop
Movies & Other shows

The pane is a search pane where each item in the list searches the beginning of the filename (name)

[Filename (name)]=[Battlestar Galactica"
[Filename (name)]=[life on Mars"
[Filename (name)]=[New Yankee Workshop"

Movies & other shows is a catch-all for all items that are not covered by the search lists. So Movies & Other Items has to exclude each of the other searches:

-[Filename (name)]=[Batlestar Galactica" -[Filename (name)]=[life on Mars" -[Filename (name)]=[New Yankee Workshop"

This works fine, except that I have quite a long list of tv shows, so lots of individual searches to update, and I always have to remember to exclude a new search from the Movies and Other Shows list.

I thought I could get around all this with smartlists, but it turns out that I would still have to create a smartlist for each show, if I wanted each show listed in a Playlist Group type view scheme.  I would only save time in terms of the exclusion smartlist (for Movies & Other Shows), but even then I would have to remember that each time I created a new smartlist for a show, I would have to exclude it from my Movies & Other Shows smartlist.
Logged
A wise man once said don't count your years, but make your years count. Or was it beers?

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8941

methinks the silent chap above is a spammer. [his post removed by JimH]  If I'm wrong, I whole-heartedly apologise.

lise, you can at least thank him for bumping your 8 month old request!!

If this is still an issue for you, there is a "listitem()" expression that would appear to work for you...

listitem([filename (name)],0,-)

Make an expression pane out the blue text and let us know how it works out. I think you'll be happy :)

-marko.

lise

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 942

Thanks Marko. I'll give it a try.
Logged
A wise man once said don't count your years, but make your years count. Or was it beers?
Pages: [1]   Go Up