Author Topic: TV-series filename structure  (Read 20106 times)

0 Members and 4 Guests are viewing this topic.

Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
TV-series filename structure
« on: April 16, 2010, 03:24:21 pm »
Which is the best structure to edit the file name of an episode?

TVSERIE NAME + 1x01 + Episode name?

buah

  • Guest
Re: TV-series filename structure
« Reply #1 on: April 16, 2010, 03:50:30 pm »
if I were you, I think that your question should be something like:

According to regexps given by default in PVD's File Scanner options, which are
1. (?i)^.*\\(?P<title>.*)(s|\b)(?P<season>[0-9]{1,3})e(?P<episode>[0-9]{1,3}), and
2. (?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>\w*\b),

what episode file names would be correct in order to meet those expressions.

I cannot give you that answer at the moment, since i haven't tested series yet.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #2 on: April 16, 2010, 07:53:36 pm »
title 1x01 eptitle or title s01e01 eptitle.

Eptitle is optional. These regex are case-insensitive. They can be modified to accommodate variations. For example, I prefer Title S01 E011, so I use...

(?i)^.*\\(?P<title>.*)(s|\b)(?P<season>[0-9]{2}) e(?P<episode>[0-9]{2,3})

Note the addition of a space between season and episode. It appears I also decided I will not live long enough to see a season greater than 99. ;)


Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
Re: TV-series filename structure
« Reply #3 on: April 29, 2010, 09:26:23 am »
Problem adding TV series from HDD.

I have all the filenames of my Tv series like this > Modern Family - 1x02 - The Bicycle Thief.avi

When I use the tool "scan folders for new movies/changed path...." all the tittles of the episodes appear only with the first word, in this example > "The".

So, when I tried to get info from IMDB, the software return a lot of results.

How can I resolve this problem? I must changed the structure of the filename?

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #4 on: April 29, 2010, 10:32:13 am »
There are two separate issues here. First, I don't know why you're only getting the first word of the episode title. You would have to examine the regex in your scanner configuration to determine why that's happening (there's probably only one expression that returns eptitle). Second, there's no need to get the episode title from the filename if that is being downloaded anyway. Download all the available episode information first. Then all that's required is the series title and season/episode numbers to match files to records.

Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
Re: TV-series filename structure
« Reply #5 on: April 29, 2010, 11:09:43 am »
I didnt change nothing.

Do you mean this?

(?i)^.*\\(?P<title>.*)(s|\b)(?P<season>[0-9]{1,3})e(?P<episode>[0-9]{1,3})

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>\w*\b)


Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #6 on: April 29, 2010, 08:59:33 pm »
Quote
I didnt change nothing.

That's probably why it doesn't work. The regex need to be tailored to suit the filename patterns you actually use.

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>\w*\b)

...comes close to properly matching your filename pattern of...

Modern Family - 1x00 - The Bicycle Thief.avi

...but I'm not sure of the \w*\b part. I think that means "any number of word characters up to a word boundary." I suppose a space is a word boundary, and that's why you're only getting the first word of the episode title. But the purpose of this is to get the title and not whatever might be following it. You don't need that if nothing follows your titles. The ".avi" clearly marks the end of your title. But you might use other file types, so a more generalize expression for the extension would be \..{3,4}—meaning "a period followed by 3 or 4 of any character." So the full expression becomes...

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>.*)\..{3,4}
« Last Edit: May 28, 2010, 10:02:21 pm by rick.ca »

Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
Re: TV-series filename structure
« Reply #7 on: April 30, 2010, 03:42:08 pm »
I found the solution >

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>[^.]+)

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #8 on: April 30, 2010, 05:46:47 pm »
Does my suggestion not work? Can you explain why the [^.]+ works in this case? It seems to me it means "explicitly match any character at the start of a string one or more times"—which, I suppose, matches each word in a title for however many words there are. But it's not clear to me how that leaves out the extension.

buah

  • Guest
Re: TV-series filename structure
« Reply #9 on: April 30, 2010, 09:37:12 pm »
Lordfinarfin,

Because of sake of other users who might found it useful, I think it was a good idea not to open new topic but to activate old one you started, both of them upon same issue.

Considering this, I suggest to pin a topic with proven regexps for different syntax of file names. In such a topic, comments wouldn't be allowed (unlike this one): only filename -> contributed proven regexp.

I suggest this, because I think that the fact that PVD is regexp compliant application is one of the most important, yet fuzzy advantage against other inferior programs.

Any thoughts?
« Last Edit: April 30, 2010, 09:39:27 pm by buah »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #10 on: May 01, 2010, 02:37:25 am »
Quote
Because of sake of other users who might found it useful, I think it was a good idea not to open new topic but to activate old one you started, both of them upon same issue.

I thought it seemed familiar... ;)

Thanks. Topics merged.

Quote
Considering this, I suggest to pin a topic with proven regexps for different syntax of file names.

Hmmm... If one were deciding what filename structures to use that would work in PVD, there are a variety of answers easily determined by examining the regex. The problem is, most users already have files and would rather not have to change them to suit the regex provided. Users in that circumstance have to accept the choice they face: Either modify the regex to suit their filenames, or change their filenames to suit the regex. Then there are those who not only use patterns not recognized by the regex provided, they use a variety of different patterns. That, of course, makes everything more complicated. Generally, each pattern will require it's own regex, and more care will be necessary to ensure the regex don't conflict with one another and are processed in the correct order.

My point is, we would never be able to pin down a finite number of filename pattern sets in use. And it would mean listing a complete set of regex (in the correct order) for each. It would be much easier—and probably more useful—to document the intended purpose of each of the regex provided, together with examples of filename patterns that are correctly interpreted by each one. From that, it might be easier for a user to find a filename pattern close to what they are using, and then determine what modification is necessary so it would work for them.

This is the format I'm imagining...

Type/Regex/ExampleComments
Type:
1. Series (title in filename)folder ignored
Regex:
(?i)^.*\\(?P<title>.*)(s|\b)(?P<season>[0-9]{1,3})e(?P<episode>[0-9]{1,3})   case insensitive
Example:
Series title s01e01 remainder ignored.ext1-3 digit series/episode numbers
Variation:
Series title S01 E01.extadd a space before the "e"


Type:
2. Series (hyphen-delimited with episode title)folder ignored
Regex:
(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>\w*\b)does "\w*\b" match a one
Example:
Series title - 1x001 episodetitle.extword episode title only?
Variation:
Series title - 1x001 episode title.ext...change to "\..{3,4}"



I could post the skeleton of such a thing, and then others could help flesh it out by posting suggestions and examples to the topic (e.g., "here's another example for type 1..."). I would then add those to the top post. Users could also post their personal modifications in the same format (e.g., "type 2 did not work for my series filenames, so I replaced it with this...").

Would such a topic be helpful, or too mind-numbing to be of any use? :-\

Offline patch

  • Older Power User
  • *****
  • Posts: 250
    • View Profile
Re: TV-series filename structure
« Reply #11 on: May 01, 2010, 03:02:36 am »
Considering this, I suggest to pin a topic with proven regexps for different syntax of file names. In such a topic, comments wouldn't be allowed ... only filename -> contributed proven regexp.
...
Any thoughts?
Why not put it in the PVD wiki
« Last Edit: May 01, 2010, 03:38:39 am by patch »

Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
Re: TV-series filename structure
« Reply #12 on: May 01, 2010, 10:14:41 am »
(sory for my english xD) I did that at work xD, so i dont have all the structures that I tried.  My expression exclude all the words that appear after a dot. Problem? you cant put a dot in the middle of an episode tittle. This formula is to remove the file the file extension.
« Last Edit: May 01, 2010, 10:22:39 am by Lordfinarfin »

buah

  • Guest
Re: TV-series filename structure
« Reply #13 on: May 01, 2010, 11:23:39 am »
Quote
My point is, we would never be able to pin down a finite number of filename pattern sets in use

We don't have to, need to or tend to. My idea was to constantly pin down in a separate pinned topic only those filename patterns discussed here and for which regexs were resolved (confirmed, proven). According to this, and taking place of an average user who's almost for sure inexperienced with regex, probably it would be appropriate to format your idea as

Type/Example (discussed in this forum)/Regex (resolved, you need to type in PVD's Preferences)

... or in PVD Wiki, why not.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #14 on: May 01, 2010, 07:21:46 pm »
Quote
We don't have to, need to or tend to...

It seems you're missing my point. Let's say someone has one specific filename pattern that's not being properly recognized by the default regex. They ask for help here, and someone suggests an expression. This expression is tested and proven to work for the given filename pattern. You're suggesting we create a list of these patterns with proven regex—in a locked topic. I'm saying this will be of limited use, if not misleading. Consider...

Another new user, using exactly the same filename pattern, finds it's entry in this list. They add the "proven" regex to their configuration, and it still doesn't work. Oops. We forgot to consider all the regex in the configuration continue to function. So a similar one in the default set still matches and occurs first. So should the list indicate which expressions should be removed when the "proven" one is added? No, we can't do that. It may still be applicable to another filename pattern. The list fails to recognize the proper solution could be to (1) replace an existing expression with the recommended one, (2) have two expressions, but put them in an order that doesn't result in conflicts, or (3) revise the existing expression so it will recognize both filename patterns. The last is obviously the best solution, and will rarely be found by anyone relying on such a list—especially if unfamiliar with regex.

My suggestion, as awkward as it may seem, provides a way of directing the user to the default expression that most closely fits their filename pattern. They may then effectively consider what changes might be necessary to their configuration (e.g., consider the three choices mentioned). If they need help they can ask. When the problem is solved—assuming there is a discussion about it—the list can be updated with another example, comment or variation. If that's not possible—because the solution is to add a completely different expression to the set—this new expression can still be documented in the same manner. I could provide a second list (in the message following the first) for such "custom" expressions. We could periodically consider which of these should be added to the default configuration.

Quote
...or in PVD Wiki, why not.

Because it doesn't provide for a one-stop place for reference, discussion and help. Anyone is welcome to copy any material in this forum and add it to the wiki—where it may serve as a more permanent and static reference.

buah

  • Guest
Re: TV-series filename structure
« Reply #15 on: May 01, 2010, 07:48:59 pm »
Well,
Please don't blame me for missing your point which was, as I understood, that it's impossible to finite sets in use.

In your last post you motivated another point of view, that's how I see it.

What I don't know is how
Quote
They add the "proven" regex to their configuration, and it still doesn't work
is possible, unless it's the order of regex set in Preferences to blame? Answer on this question will help me to better understand regex, and indirectly PVD functioning.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #16 on: May 01, 2010, 09:23:28 pm »
The expressions are processed in order—until a match is found. So if one is added to a position in the list after an existing one that already matches, it won't be processed. The fact of a match does not mean the existing expression does so correctly. Not only does the added expression have to match, preceding expressions that aren't meant to match have to not match.

But I think you've illustrated a bigger flaw in the idea. Most users don't understand regex, and are therefore reluctant to accept one of the necessary evils: either (1) learn enough about regex to make the modification necessary so your filenames are correctly recognized, or (2) change your filenames so they are recognized by the default regex. Providing a list will only appeal to those who want to do neither, and shift the pain onto those maintaining the list. I think I'll save my energy for those interested in helping themselves.

buah

  • Guest
Re: TV-series filename structure
« Reply #17 on: May 01, 2010, 10:35:46 pm »
The expressions are processed in order—until a match is found. So if one is added to a position in the list after an existing one that already matches, it won't be processed. The fact of a match does not mean the existing expression does so correctly. Not only does the added expression have to match, preceding expressions that aren't meant to match have to not match.

Now I'm confused. In my last post I said that it's not clear to me how it's possible for a proven regex not to work, unless it is not set in the right place in Preferences, then you confirmed it won't work if it's not set in a right place in Preferences, then you said that I've illustrated a bigger flaw in the idea?

And my idea was exactly to save your energy, which you undoubtedly spend a lot, and I personally thank you for that.
« Last Edit: May 01, 2010, 10:52:31 pm by buah »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #18 on: May 02, 2010, 02:28:19 am »
Quote
Now I'm confused.

I don't understand why. You asked a question. I answered it fully. I hope it's not because your question was rhetorical. ::)

My opinion that the idea is flawed was a separate idea, stated in a separate paragraph. I'm sorry if you feel it's a rejection of your idea. But after considerable thought (which I think is evident from my previous posts), it's one I believe is reasonable and with which I'm perfectly comfortable.

buah

  • Guest
Re: TV-series filename structure
« Reply #19 on: May 02, 2010, 03:36:33 am »
I asked it hopefully you'd answer something different than me.

 

anything