![]() |
|
Regular Expressions - Printable Version +- XBMC Community Forum (http://forum.xbmc.org) +-- Forum: Help and Support (/forumdisplay.php?fid=33) +--- Forum: XBMC General Help and Support (/forumdisplay.php?fid=111) +--- Thread: Regular Expressions (/showthread.php?tid=25349) |
- tempxbmcusr - 2007-06-19 21:15 J_K_M_A_N and szsori: Thank you both for your responses. I never really thought about the fact that the season number on the files themselves would be causing problems. It was one of those oversights when you are too used to your way. Thanks! path for tv ep info - tempxbmcusr - 2007-06-19 23:32 I have another question. Do you know how the database sees the path for the file? If, so does it depend on where the "Set Content" flag is set? When I changed the file name to just including the ep number (see above posts) and set the TV directory (SMB:\\COMPUTER\TV\Series\Season #\## - ep name.avi) to be the content TV, it did not find the episodes. However, when TV content is set to NONE and I set the individual series folder to TV it was able to find an episode. There are too many series folders to do it individually and there has to be a way to put it higher in the path hierarchy. Therefore I thought that maybe there was a difference in the path that depends on where the content is set. So I added a *[/\/] to the beginning of the regexp so that it would ignore everything before the [Ss]eason part of the path. But this did not work. Code: <tvshowmatching>Also, does a regexp work from R->L or L->R when it is looking at a string (path)? Once I get mine working I am willing to write a xbmc regexp generator based on user defined paths and possibly "set content" flags (if that ends up being involved). Thanks! - J_K_M_A_N - 2007-06-19 23:38 szsori Wrote:Not entirely true, JKMAN... if episode is always 2 digits, then you can assume that the remaining numbers are the season: I was just basing my answer on the fact that he said the season number was 1 or 2 digits. He didn't say it was always 2. I should have been more clear. I believe the first directory below the set content folder is used as the show name. I also believe that spiff added the option to set content on the folder of the show itself. You have to watch for the 's'. One says TV Shows and I think the other says TV Show. Good luck. J_K_M_A_N - downset211 - 2007-07-21 09:09 I've been trying to figure this out on my own for awhile but have been having problems so hoping someone here might be able to help. here's what I have. So far this is working - SeriesName\Season 1\SeriesName - 08.avi all of Season 1 shows up fine in the library that way, however - SeriesName\Season 3\SeriesName_66.avi which is episode 66 of the series or episode 15 of season 3 or - SeriesName\Season 6\SeriesName_124.avi which is episode 124 of the series or episode 4 of season 6 those don't show up in the library at all. I know the naming scheme is kinda funky, is SeriesName_EpisodeNumber.xxx tv.com does use those episode numbers (season 3 episode 66 vs season 3 episode 15)so I was hoping i wouldn't have to go renaming 6 season's worth of stuff if I didn't have to. I really hope I'm making sense here but I've been racking my brain out with these expressions but I must just be completely dense and can't figure it out. Hoping someone could help if it can be done at all, or let me know if it's just not possible either. - jmarshall - 2007-07-21 09:41 You have to rename. Frustration... - clintshaneh - 2007-07-22 02:10 Been working on this for hours now and can't seem to get it.. My directories are setup like this: TV/Show/S03E02 - episodetitle.avi and i'm trying to use : <regexp>S[0]*([0-9]+)E[0]*([0-9]+)[^\\/]*</regexp> and the scans find nothing, any ideas? understanding expressions - earthtorob - 2007-07-24 23:22 I found a website the helps explains how to use regular expressions. http://www.regular-expressions.info/tutorial.html I'm still having problems though. My files are organized as follows: Tv Shows\Name\season #\(###) Title.avi I'm trying.. <regexp>Season ([0-9])[\\(.]([0-9]+)[^\\/]*</regexp> I think... Season - makes match. Is this needed? ([0-9]) - Parens () says to use match inside, brackets [] define char set 0-9 [\\(.] - Brackets [] say to match data inside \\(. says match \( and one char. ([0-9]+) - () again says to use data inside, [0-9]+ says match any number of digits. [^\\/]* - I don't know what it does. everyone else seams to like it though. So.... that is what I'm trying to match and you see what I'm trying. It's not working. ![]() one other question. If I define some regular expressions in the advancedsettings, does it wipe out the defaults? Thanks. - szsori - 2007-07-24 23:34 I don't think XBMC can pull the season from the directory, so you'll have to get the season number into the filename itself. If your (###) is the season and episode combined, you should consider separating them with an x or period. Recommended naming conventions: Series - S01E01 - Episode Name.avi Series - 01x01 - Episode Name.avi You can leave off "Series", since the scraper pulls that from the folder, but I prefer having it on there in case I'm moving files around. Episode name is also optional, but it helps in case you're viewing stuff in file mode and looking for a specific episode. - earthtorob - 2007-07-24 23:48 I beive it does use the folder name to dientify the show. I've read it somewhere, could someone verify? Also the (###) is the season ep number combined. ie : Season 4 episode 13 would be (413). I thought about using ([0-9])([0-9][0-9]) That would use the first # and then ##. But how does the computer know which number is the season number and which is the ep number? I feel like I'm defining variables. Is that what I'm doing? - jmarshall - 2007-07-25 00:01 Should be able to handle anywhere within the path of the file. I suspect you need to escape the (. Try: <regexp>Season ([0-9])\\\(([0-9]+)[^\\/]*</regexp> Note that the first \\ is just matching \, then \( matches (. As these are characters used to construct regexps, we need to escape them with a \. Sites such as http://www.quanetic.com/regex.php are useful for testing (note it'll escape stuff for you). Cheers, Jonathan |