Kodi Community Forum

Full Version: Scan and regex
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I started yesterday using kodi, and I encounter some trouble with the scan of my anime/tvshow files => some show are not listed in the TVShow section (but do are in the file section)
I figured out that thoses files didn't match the naming convention : https://kodi.wiki/view/Naming_video_files/TV_shows so I tried to create some regex to match different folders (somes with SerieName\S01\xxx42xxx.avi, others with just SerieName\xx42xx.avi)
<advancedsettings>
<tvshowmatching action="append">
    <regexp>()[\\/]S([0-9]+)[\\/]() ([0-9]+)([^\\/]*)$</regexp>
    <regexp>() S([0-9]+) ([0-9]+) [Vv]ostfr([^\\/]*)$</regexp>
    <regexp>() ([0-9]+) [Vv]ostfr([^\\/]*)$</regexp>
    <regexp>() ([0-9]+)([^\\/]*)$</regexp>
</tvshowmatching>
</advancedsettings>

But now, for some folders I have each episode twice, and another case is that one ep appears 13 times, the 12th others are fine.

Did you already had this? How can I fix it?
Thanks
Hello @Skwi

Great that you found the wiki and read there first.

Regex's are good if you have a consistent naming convention throughout. Sounds like you are using a few different naming conventions.

I can't help you with your regex's, but I will give you this little bit of very important information from someone who sees these problems all the time. Forget the Regex's. Just name them in accordance with the wiki page. Think of all the time you have already spent trying to make it work, and all the future time you will invest. You probably could have fixed the names with a Bulk Renamer in half the time.

I don't know how large your library is or how many actual duplicates you have, but if a good majority of the library is affected, then start again. Remove the Sources, Answer Yes when asked to remove the entries, Clean Library and start again. Obviously with correctly named episodes. And also make sure you are checking the names of the TV Show at the TVDB scraper site.
Hi, thanks for you answere.
I did what you say, plus if in the future I want to change kodi for another I won't have to tweak the conf' (I used bulk rename utility, very powerfull)

I don't know how the default regex work, but my supposition is that my files matches 2 or more extended regex, and because I didn't put any "order" all my regex were checked.
I think that addind an order to my regex (8,9,10,11 for example because The order of the search. ie. Patterns numbered 1 will be matched first and those numbered 7 will be matched last.) will fix this problem (if 8 is matched, it won't go further) => don't know if that's possible

Plus, I know it is not designed to do so, but adding a "recreate source" option in the "Videos>Files would be helpfull => I had to delete then recreate my sources