English > Support
TV-series filename structure
Lordfinarfin:
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
rick.ca:
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.
--- End quote ---
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.
Lordfinarfin:
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.
rick.ca:
--- Quote from: Lordfinarfin 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.
--- End quote ---
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.
Lordfinarfin:
--- Quote from: rick.ca on May 04, 2010, 10:42:17 am ---
--- Quote from: Lordfinarfin 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.
--- End quote ---
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.
--- End quote ---
I will try it.
My regex is ok?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version