PDA

View Full Version : TV Show Regex String


theophile
2009-01-12, 06:53
Okay so I'm downloading a TV show with episodes in the following format:

Name of Show/Season 01/101 - Pilot.avi

In order to detect these properly, I created the following lines in my advancedsettings.xml file:
<tvshowmatching>
<regexp>([0-9]+)([0-9][0-9])[^\\/]*</regexp>
</tvshowmatching>

This was per the specific example found here, under Example 2:
http://xbmc.org/wiki/?title=TV_Shows#Custom_Directory_Structure_.26_Fil e_Names

However, when refreshing the library, no episodes are detected. One threshhold question is whether the scanner looks for files merely by file extension or whether it scans the files for content. Since this is a torrent download, the files are present but not playable yet as they are not completely downloaded.

So is the scanner not picking these up because the files are incomplete or because there's a problem with the regex engine?

Thanks!

althekiller
2009-01-12, 07:41
So is the scanner not picking these up because the files are incomplete or because there's a problem with the regex engine?!

That's a pretty audacious statement. The scanner only looks at filenames so the incomplete files shouldn't be a problem. The regex engine would likely work fine if your advancedsettings.xml was properly formatted. You're missing the <advancedsettings> tags...

theophile
2009-01-12, 17:07
That's a pretty audacious statement.
Actually, it was a question. Please don't take it personally. I was only asking whether I had gotten the string right.

The scanner only looks at filenames so the incomplete files shouldn't be a problem. The regex engine would likely work fine if your advancedsettings.xml was properly formatted. You're missing the <advancedsettings> tags...
I have the <advancedsettings> tags in the file, I simply didn't include them in the snip I posted in the OP. Nevertheless, the scanner is still not picking up the files. Is there something else I can try?

vdrfan
2009-01-12, 17:47
Sure, post a full debug log (pastebin or similar) so we can see what's happening while scanning.

CapnBry
2009-01-12, 19:40
I've found the biggest problem with the TV scanner not working is not that there was a problem regexing the episode, but because the show name is incorrect. Like I had directory:
The Life and Times of Tim/Season 1/XXX - 108 - XXX.mkv

I tried all sorts of regex combinations and file names to try and pick up information and nothing would work. When I fired up the debugger on it, it was regexing season 1 episode 08 just fine, but on thetvdb it is called "The Life & Times of Tim". I changed the directory name and worked like a champ.

So maybe check your directory name against the scraper and make sure if you search for it in manually, it finds the show?

theophile
2009-01-12, 20:42
Interesting thought. My directory structure is actually:

Scrubs/Season 01/101 - Pilot.avi

Could the fact that the Season number has a leading "0" be throwing it off? I suppose I could change it to see...

CrashX
2009-01-12, 22:10
Try the following:-

Choose Library Mode ..
Right Click on the show and click show information ( I believe not sure .. It is one window that shows cast information )...
Click on Refresh tab on the bottom and it should prompt a message saying to refresh all episode.. click yes ) ..

theophile
2009-01-12, 23:58
Try the following:-

Choose Library Mode ..
Right Click on the show and click show information ( I believe not sure .. It is one window that shows cast information )...
Click on Refresh tab on the bottom and it should prompt a message saying to refresh all episode.. click yes ) ..

That did it. Thanks! Not sure why it didn't pick them up on a library refresh, but I'll take it!

CrashX
2009-01-13, 00:31
You should probably open a ticket for it since I had the same problem .. I resolved by doing that .. You only need to do it once ... After that it will work always for that show.

edwindotson
2009-01-15, 03:08
This solution works for short term. But i have some shows that have 10 seasons with 24 epsiode each and that can take quite a while and then you are not able to do other functions.

Thanks,

theophile
2009-01-15, 03:38
I also discovered that if you add a regex string to your advancedsettings.xml file, the engine will only match filenames with that format. If you want the default matches to be recognized, you have to add all those strings to advancedsettings.xml too.

IMHO, strings added in this way should be additions to the default matches, not replacements.

tslayer
2009-01-15, 03:43
Did you read the XBMC manual at all?

http://xbmc.org/wiki/?title=AdvancedSettings.xml

And I quote:

If the argument action="append" or append="yes" is supplied, the default videostacking regular expressions will remain intact and the user specified ones will be added to the end. Example:


<moviestacking action="append">
<regexp>custom[ _\.-]*([0-9a-d]+)</regexp>
</moviestacking>

The "append" and "action" arguments described in the videostacking section work the same for tvshowmatching tags. Examples of matching regexps for certain filenames can be found on the TV_Shows page.

Anyhow, more details in the manual.

theophile
2009-01-15, 05:31
That page is more than a little convoluted. Despite the amount of time I've spent on it, I did not see that excerpt, perhaps because it was not in the "tvshowmatching" section where I was concentrating, nor in the introductory portion of the page, or maybe because the veiled reference in the "tvshowmatching" section to an append command refers to a "videostacking" section which doesn't exist because it has been renamed. In fact, the only way I was able to find the quoted text at all (even though it is right above the "tvshowmatching" section) was by executing a text search for it.

In short, my post before this one was primarily a warning for other people likely to be confused by this, as I was, even though I'm fairly handy with Linux and have a working and stable installation of MythTV (an impressive feat in and of itself).

tslayer
2009-01-15, 05:42
If you'd like to work that page, you can be provided access to rework it.

Otherwise, I'll just accept a nice thank you.

theophile
2009-01-15, 15:51
Sure, I'd be happy to clean things up a little if I can. While I'm at it, I am under the impression that there are some functions that can be performed by the advancedsettings.xml file that are not mentioned in the manual page. For example, I've seen the "skiploopfilter" function in forum posts but it doesn't seem to be written up in the manual. If there are other such functions that have been added since the manual was last updated, I could try to stick those in as well, if you want.

...and you can have the "thank you" anyway. :nod:

tslayer
2009-01-15, 17:31
That would be great. You can send a PM to pike asking for Ninja access. That will allow you access to edit the manual.

Thanks a lot!

sryounger83
2009-01-26, 06:54
I am having the same problem with naming the tv shows correctly for the xbmc to recognize them. Currently I have the following path
M:\xbmcmedia\movies\tvsseries\House M.D.\House M.D. Season 1\House M.D. S1D1E1 - Pilot.avi
S= Season
D= Disc
E=Episode

I have all the episodes for each season in a single folder labeled "as mentioned above" tv series name Season x (House M.D. Season 1) all 22 episodes are listed in that folder with the following names House M.D. S1D1E1 - Pilot.avi and so on.

If someone could tell me what I need to do differently in organizing or what. I just want it to work!!! Or if someone has the code necessary that I can just copy and paste to keep my current filing method that would be better since I have over 500 Episodes of various seasons already burned, named and filed.
Thanks and I hope someone can help!!

jmarshall
2009-01-26, 07:20
[Ss]([0-9]+)[Dd][0-9]+[Ee]([0-9]+)([^\\/]*)$


EDIT: This obviously assumes that the episode number is the usual one, and not something you've made up based on the disc number.

Cheers,
Jonathan

sryounger83
2009-01-26, 08:25
Thank you for your help. I am naming the episodes in order as they are as a season and not by disc. So a 20 episode season would have episodes numbered 1-20 but the disc number would change that is all.

Ex.
House M.D. S1D1E1 (Assuming there are 5 episodes on disc 1. Also I am going by what IMDB.com says the episode number is)
House M.D. S1D2E6

The only question I have is, what do I do with that line of code you posted. Where do I paste that?

Thanks again for all your help!

jmarshall
2009-01-26, 08:58
You put it in advancedsettings.xml. Read the earlier posts in this thread. It's also in the online manual.

Cheers,
Jonathan