Kodi Community Forum
Added regex for TVshow matching does not work - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Added regex for TVshow matching does not work (/showthread.php?tid=137982)



Added regex for TVshow matching does not work - lordsaul - 2012-08-09

Hi,

I'm trying to add a custom regex to help scan tv shows. I have done the following:

1) created

Code:
<advancedsettings>
    <tvshowmatching append="no">
      <regexp>([0-9]+)\.([0-9]+)[^\\/]*</regexp>
   </tvshowmatching>
</advancedsettings>

at userdata/advancedsettings.xml

2) Confirmed it loads using the debug log...

Code:
0:16:04 T:5320 M:4294967295  NOTICE: Loaded advancedsettings.xml from special://profile/advancedsettings.xml
20:16:04 T:5320 M:4294967295  NOTICE: Contents of special://profile/advancedsettings.xml are...
                                            <advancedsettings>
                                              <tvshowmatching append="no">
                                                <regexp>([0-9]+)\.([0-9]+)[^\\/]*</regexp>
                                              </tvshowmatching>
                                            </advancedsettings>
20:16:04 T:5320 M:4294967295  NOTICE: Getting hardware information now...

3) Verified the regex works via http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx . The test filename

Code:
Leverage 1.02 the episode name.mp4

is matched by the regex

After all this, the rescan of the folder structure does not pickup the files in this format. Any suggestions? Is there something "special" about the regex syntax of XBMC? What else can I test or try?

cheers,

P


RE: Added regex for TVshow matching does not work - jmarshall - 2012-08-10

There's nothing necessarily wrong with your regexp. The Debug Log while you refresh a show that has episodes in this format is the next place to look.


RE: Added regex for TVshow matching does not work - lordsaul - 2012-08-10

Well, without knowing what I am particularly looking for, it just appears as if the scan didn't find anything. No errors, just this below.

Code:
20:16:13 T:5320 M:4294967295   DEBUG: ------ Window Init (DialogVideoScan.xml) ------
20:16:13 T:5320 M:4294967295    INFO: Loading skin file: DialogVideoScan.xml
20:16:13 T:5884 M:4294967295   DEBUG: thread start, auto delete: 0
20:16:13 T:5884 M:4294967295  NOTICE: VideoInfoScanner: Starting scan ..
20:16:13 T:5884 M:4294967295   DEBUG: VideoInfoScanner: No (new) information was found in dir F:\temp\Videos\
20:16:13 T:5884 M:4294967295  NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 00:00
20:16:13 T:5884 M:4294967295    INFO: Video scan was stopped or finished ... restoring FindRemoteThumbs
20:16:13 T:5884 M:4294967295   DEBUG: Thread 5884 terminating
20:16:13 T:5320 M:4294967295   DEBUG: ------ Window Deinit (DialogVideoScan.xml) ------

any thoughts? I really don't want to rename 100s of files....:-S


RE: Added regex for TVshow matching does not work - jmarshall - 2012-08-10

Do the tvshows show up at all? i.e. are just the episodes missing?


RE: Added regex for TVshow matching does not work - lordsaul - 2012-08-10

The TV show (Leverage in my test) shows up, it pulls down fan art for the background, and appears in the progress bar. If I add an "episode" using the 1x01 format it is recognised and added with photo (even though its not a real mp4, its a text file renamed to an mp4, but follows the format). Whenever I add the test item in my new format (that the regex should find) it is not found on the scan.
I should also mention that I have tried this on two separate computers/copies of XBMC with the same result.


RE: Added regex for TVshow matching does not work - jmarshall - 2012-08-12

So TV Show Information -> Refresh -> Refresh all episodes on the Leverage show, and get the Debug Log from that.


RE: Added regex for TVshow matching does not work - lordsaul - 2012-08-12

well - I'm not sure why, but re-scanning the Leverage folder (as opposed to the root folder) worked. Bizzarely it *now* scans correctly from the root folder when I add additional files in the new format.

In other news, the other machine I was testing on had 2 XMBC installations, I put the file in the wrong folder in that one (oops). Still not sure why the first machine wasn't updating content until today (only change I made to advancedsettings on that one was to set logging level to 3).

Anyway - its seems to be working, so thanks.


RE: Added regex for TVshow matching does not work - lordsaul - 2012-08-12

after indexing load of content, it seems that the scan just sometimes "gets bored" and stops. Going back into individual programs and scanning seems to work, but sometimes when scanning from the root it seems to only do so much scanning before stopping.