Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
first, there was a bug in svn that i fixed @ rev 8255.
second;
a regexp for your scheme would be:
season([0-9]+)[\\/]episode([0-9]+)[^\\/]*
now, the explanation (man, i'm patient today):
the season part should be explanatory; we need it to say 'season' at the start of of pattern. then we need 1 or more numbers. we state that we only allow numbers by the [0-9] part. this defines a list of allowed characters - 0-9 is expanded into 0 1 2 3 4 5 6 7 8 9. we say that we need one of more this using the + sign. now, since this is the season number and that's what we are after, we select this part. this is done by embracing it in parantheses - ([0-9]+). now we need either a backslash or a slash. since a backslash has a special meaning in regular expressions we tell the parser that we mean a litteral \ by doing \\. then it needs episode literally, and we do the same thing to select the episode number. finally we want to make sure we match at the end of the path and not in the middle of it. we do that by specifying a list of not allowed characters, namely \ and /. this we do by putting a ^ inside the []'s, inverting the meaning of the list. finally we need 0 or more of these non-slash characters, which we indicate by a *.
Posts: 447
Joined: Feb 2006
Reputation:
1
Wow spiff. That was VERY helpful. Thank you for being patient today. I may actually be able to work mine out now.
If I figure that out, maybe I can figure out how to change the wiki. I will do my best to make you proud.
J_K_M_A_N
Posts: 530
Joined: May 2005
Reputation:
5
DonJ
Retired Team-Kodi Member
Posts: 530
\[ means a literal [
[Ss] means a capital S or a small s.
\] means a literal ]
_ means underscore
[Ee] means E or e
regular expressions are not case insensitive
[\._ \-] means literal . or underscore or literal -
Your regular expression looks ok to me.
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
you're missing the spaces...
plus you're saying that your pattern should start with a \ or a /, inconsistent with the seriesname part of your example.
Posts: 26,215
Joined: Oct 2003
Reputation:
187
J_K_M_A_N (man that's hard to type :p)
You are wanting to match:
\Series Name - Season # - Episode ## - Episode Name.avi
Assuming your spacing includes those spaces, you need the "Season " then you need the number, then " - Episode " then the number:
Season ([0-9]+) - Episode ([0-9]+)[^\\/]*
You don't care what's after the Episode number, except that you don't want a slash as it has to be in the filename.
I'm sure you can mod it to include/not include spaces as necessary.
And please: Add to the wiki with your example regexp, the names it matches, and your explanation on how it works.
Cheers,
Jonathan
Posts: 447
Joined: Feb 2006
Reputation:
1
I am losing my mind! Now my xbox won't boot if I have an advancedsettings.xml file on it with the <tvshowmatching> entries in it. This is the EXACT contents on my advancedsettings.xml file:
<AdvancedSettings>
<displayremotecodes>true</displayremotecodes>
<tvshowmatching>
<regexp>Season ([0-9]+) - Episode ([0-9]+)</regexp>
</tvshowmatching>
</AdvancedSettings>
If I ONLY have displayremotecodes in it it works fine. When I add <tvshowmatching>, it hangs.
I don't have a debug log because it doesn't make it that far. This is all I get:
18:40:51 M: 52211712 NOTICE: -----------------------------------------------------------------------
18:40:51 M: 52191232 NOTICE: Starting XBoxMediaCenter. Built on Mar 18 2007
18:40:51 M: 52191232 NOTICE: Q is mapped to: Harddisk0\Partition1\XBMC
18:40:51 M: 52191232 NOTICE: Log File is located: Q:\xbmc.log
18:40:51 M: 52191232 NOTICE: -----------------------------------------------------------------------
18:40:51 M: 52191232 NOTICE: Setup DirectX
18:40:52 M: 52146176 NOTICE: load settings...
18:40:52 M: 52146176 NOTICE: loading T:\guisettings.xml
18:40:52 M: 52019200 NOTICE: Getting hardware information now...
18:40:52 M: 52019200 NOTICE: Checking resolution 10
18:40:52 M: 52019200 NOTICE: Setting autoresolution mode 4
I have to quit for now. I am going crazy. Sorry to have wasted all your time. If I get it working I will DEFINITELY update the wiki. Thanks so much for the help.
J_K_M_A_N
Posts: 26,215
Joined: Oct 2003
Reputation:
187
You must have the <twopart> tag present due to a bug (that has been fixed).
Posts: 447
Joined: Feb 2006
Reputation:
1
THANK YOU!
I will try again.
J_K_M_A_N