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

0 Members and 3 Guests are viewing this topic.

Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
Re: TV-series filename structure
« Reply #20 on: May 03, 2010, 01:00:16 pm »
Continue with my last Thread about it......

To test de regex I delete all the regex availables.

File name example >
<tv serie tittle> - <season - episode> - <episode tittle>

Example: Aqui no hay quien viva - 1x01 - Erase una mudanza.avi


(?i)^.*\\(?P<title>.*)(s|\b)(?P<season>[0-9]{1,3})e(?P<episode>[0-9]{1,3}) > original > Result > "Aqui no hay quien viva - 1x01 - Erase una mudanza"

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

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

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>)\..{3,4} > suggested by rick.ca > result: "Aqui no hay quien viva - 1x01 - Erase una mudanza"


At this point I started trying several combinations found trough internet, due to my lack of experiense with code or language

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>*\W)$ > Result: "Aqui no hay quien viva - 1x01 - Erase una mudanza avi" it doesnt remove the file extention

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>[^\\/]*[.avi$]) > Result: "Aqui no hay quien viva - 1x01 - Erase una mudanza avi" it doesnt remove the file extention


I manage to solve the problem, "WITH MY FILE STRUCTURE" with next expresion.

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>[^.]+) > ok > result: "Erase una mudanza"

The problem I found with it is that I cant put a dot into the episode title

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #21 on: May 03, 2010, 11:53:12 pm »
Sorry, I meant ...(?P<eptitle>.*)\..{3,4} not ...(?P<eptitle>)\..{3,4}. Without the "any number of any character" there could be no match for <eptitle>. I suppose that results in the expression doing nothing, and the whole filename is therefore treated as a Title by default. :-\

Your solution of ...(?P<eptitle>[^.]+) means "one or more character not a period." That, of course, will match everything up to a period, whether in the episode title or the beginning of the extension—and the rest is ignored.

BTW, this whole business is not so complicated if you consider it's almost impossible not to match "(YEAR)" or "0x00" or "S00 E00". So if these are used in filename patterns to separate a movie title from other information or a series title from an episode title (or other information), it's difficult to go wrong.

Quote
Second, there's no need to get the episode title from the filename if that is being downloaded anyway.

This may not always be true. When updating episodes as they're released, the IMDb plugin uses the episode title to search for the record (even though the season and episode number are known). This is not the case for The TVDb. I download from both, so I get the episode title from there first, and then the IMDb is able to use that in it's search. If an episode title is provided, but the IMDb hasn't yet recorded one (i.e., it's still using something like "Episode #2.19"), that record probably won't be found. I suppose that doesn't matter, however, because it probably doesn't have anything of value. So, when updating episodes as they are released from the IMDb only, it may very well be helpful to get the episode title from the filename.

For updating episodes not recently released, it's more efficient to update the series record. This will add the URL's of all available episodes, and then no search will be necessary to find them.

Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
Re: TV-series filename structure
« Reply #22 on: May 04, 2010, 09:42:49 am »
Rememenber that Im a spanish user, so, sometimes I have the episode names in spanish, and IMDB return the name in english, that is why I prefer this way.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #23 on: May 04, 2010, 10:42:17 am »
Rememenber that Im a spanish user, so, sometimes I have the episode names in spanish, and IMDB return the name in english, that is why I prefer this way.

I was commenting for the benefit of others reading this as well. In your circumstance, where the IMDb record is in English, you'll probably do better updating the series than attempting to update each episode as it is added—using a Spanish episode title it will not be able to find. By setting the plugin not to overwrite Title, you should end up with a Spanish Title and English Original title. And, for a Spanish series, adding the episode title from the filename is only going to help.

Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
Re: TV-series filename structure
« Reply #24 on: May 04, 2010, 12:49:45 pm »
Rememenber that Im a spanish user, so, sometimes I have the episode names in spanish, and IMDB return the name in english, that is why I prefer this way.

I was commenting for the benefit of others reading this as well. In your circumstance, where the IMDb record is in English, you'll probably do better updating the series than attempting to update each episode as it is added—using a Spanish episode title it will not be able to find. By setting the plugin not to overwrite Title, you should end up with a Spanish Title and English Original title. And, for a Spanish series, adding the episode title from the filename is only going to help.

I will try it.

My regex is ok?

Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
Re: TV-series filename structure
« Reply #25 on: May 04, 2010, 04:57:44 pm »
Rememenber that Im a spanish user, so, sometimes I have the episode names in spanish, and IMDB return the name in english, that is why I prefer this way.

I was commenting for the benefit of others reading this as well. In your circumstance, where the IMDb record is in English, you'll probably do better updating the series than attempting to update each episode as it is added—using a Spanish episode title it will not be able to find. By setting the plugin not to overwrite Title, you should end up with a Spanish Title and English Original title. And, for a Spanish series, adding the episode title from the filename is only going to help.

Well. Now I test with Babylon 5 (english serie). I have the episode title in spanish.

If I add a this TV serie using "New movie master (CTRL+M)", setting:
Movie Information > IMDB
Movie Poster > nothing
cover > nothing
File information > "active"
Tittle > Babylon 5
Original Tittle > "nothing"
File(s) > I browse to the main folder Babylon 5

I desactivate the option in the pluggin to not allow to replace the Tittle.

The  result is that PVD get the episode tittle from IMDB in english.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #26 on: May 04, 2010, 09:00:23 pm »
Setting a field to not be overwritten only makes a difference if something is already there. If NMM runs the download plugin first, it's going to get the English episode title. If you run the file scanner after downloading the series, it will replace the episode titles with those from the filenames. If you then update the episodes, with the overwrite setting off for Title and on for Original title, you should end up with a Spanish Title and English Original title—as in the attached screen shot.

[attachment deleted by admin]

Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
Re: TV-series filename structure
« Reply #27 on: May 05, 2010, 02:50:30 pm »
Setting a field to not be overwritten only makes a difference if something is already there. If NMM runs the download plugin first, it's going to get the English episode title. If you run the file scanner after downloading the series, it will replace the episode titles with those from the filenames. If you then update the episodes, with the overwrite setting off for Title and on for Original title, you should end up with a Spanish Title and English Original title—as in the attached screen shot.

If I first run NMM it get episode tittle from IMDB. Then If I launch the file scanner, this tool do not detect any change, so the episode tittle remain in english. DO you know why?

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: TV-series filename structure
« Reply #28 on: May 05, 2010, 07:30:30 pm »
If the file scanner has detected a change in the file, it should update the information as I described. I can only guess you're still asking NMM to add files—so when the scanner is run afterwards, no changes are detected.

Offline Lordfinarfin

  • Member
  • *
  • Posts: 23
    • View Profile
Re: TV-series filename structure
« Reply #29 on: May 06, 2010, 09:59:05 am »
If the file scanner has detected a change in the file, it should update the information as I described. I can only guess you're still asking NMM to add files—so when the scanner is run afterwards, no changes are detected.

Thanks for your help, The problem was that I am asking NMM to add files.