Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
TV Show Matching matches too much - remove RegEx
#1
Hello,

I have had this problems for years and was never able to find a solution. I am organizing my TV shows with a program (SickChill) that does proper naming for me:

Every show has it's own folder, and the naming is configured as following:
Season_%0S/%S.N_S%0SE%0e_%E.N_%Q.N
which results in:
Single EP: Season_02/Show.Name_S02E03_Ep.Name_720p.HDTV.ext
Multi-EP: Season_02/Show.Name_S02E03E04E05_Ep.Name_720p.HDTV.ext

So all my episodes are correctly named and also correctly matched, with an annoying problem: certain Episodes are matched twice, due to numbers in Episode Names or Quality. I will add the list of Filenames and the wrongly matched series/episodes below.
All I want to do (and I tried with adjusting the advancedsettings.xml) is to enforce Kodi only to match the following pattern: S01E01, leaving everything else be.

Can you enlighten me how to achieve this goal?

Thanks for your support!


The.Resident_2018/Season_02/The.Resident_S02E01_004230_1080p.WEB.DL.mkv -> S02E4230
The.Resident_2018/Season_02/The.Resident_S02E01_004230_1080p.WEB.DL.mkv -> S02E1080
The.Simpsons_1989/Season_18/The.Simpsons_S18E21_24.Minutes_720p.HDTV.mkv -> S18E24
The.Simpsons_1989/Season_22/The.Simpsons_S22E21_500.Keys_1080p.WEB.DL.mkv -> S22E500
The.Simpsons_1989/Season_28/The.Simpsons_S28E17_22.for.30_720p.HDTV.mkv -> S28E22
The.Simpsons_1989/Season_29/The.Simpsons_S29E13_3.Scenes.Plus.a.Tag.From.a.Marriage_1080p.WEB.DL.mkv -> S29E03
Family.Guy_1999/Season_11/Family.Guy_S11E16_12.and.a.Half.Angry.Men_720p.HDTV.mkv -> S11E12
Family.Guy_1999/Season_12/Family.Guy_S12E13_3.Acts.of.God_720p.HDTV.mkv -> S12E03
NCIS_2003/Season_13/NCIS_S13E07_16.Years_720p.HDTV.mkv -> S13E16
Greys.Anatomy_2005/Season_02/Greys.Anatomy_S02E25_17.Seconds_720p.HDTV.mkv -> S02E17
Greys.Anatomy_2005/Season_14/Greys.Anatomy_S14E09_1.800.799.7233_720p.HDTV.mkv -> S14E01
Doctor.Who_2005/Season_03/Doctor.Who.2005_S03E07_42_720p.BluRay.mkv -> S03E42
Doctor.Who_2005/Season_03/Doctor.Who.2005_S03E07_42_720p.BluRay.mkv -> S03E720
South.Park_1997/Season_15/South.Park_S15E12_1%_SDTV.avi -> S15E01
S.W.A.T_2017/Season_02/S.W.A.T.2017_S02E10_1000.Joules_1080p.WEB.DL.mkv -> S02E1000
Brooklyn.Nine-Nine_2013/Season_01/Brooklyn.Nine.Nine_S01E07_48.Hours_1080p.WEB.DL.mkv -> S01E48
Brooklyn.Nine-Nine_2013/Season_03/Brooklyn.Nine.Nine_S03E12_9.Days_1080p.WEB.DL.mkv -> S03E09
Brooklyn.Nine-Nine_2013/Season_05/Brooklyn.Nine.Nine_S05E09_99_1080p.WEB.DL.mkv -> S05E99
Brooklyn.Nine-Nine_2013/Season_05/Brooklyn.Nine.Nine_S05E09_99_1080p.WEB.DL.mkv -> S05E1080
Suits_2011/Season_05/Suits_S05E16_25th.Hour_720p.HDTV.mkv -> S05E25
Suits_2011/Season_07/Suits_S07E08_100_720p.HDTV.mkv -> S07E100
Suits_2011/Season_07/Suits_S07E08_100_720p.HDTV.mkv -> S07E720
Breaking.Bad_2008/Season_02/Breaking.Bad_S02E09_4.Days.Out_SDTV.avi -> S02E04
Californication_2007/Season_07/Californication_S07E08_30.Minutes.or.Less_1080p.BluRay.mkv -> S07E30
Castle_2009/Season_03/Castle.2009_S03E06_3XK_SDTV.avi -> S03E03
Charmed_1998/Season_08/Charmed_S08E14_12.Angry.Zen_SDTV.mkv -> S08E12
Heroes_2006/Season_01/Heroes_S01E19_07%_720p.HDTV.mkv -> S01E07
House.MD_2004/Season_06/House_S06E13_5.to.9_SDTV.avi -> S06E05
New.Girl_2011/Season_05/New.Girl_S05E14_300.Feet_720p.HDTV.mkv -> S05E300
Numb3rs_2005/Season_06/Numb3rs_S06E03_7.Men.Out_720p.HDTV.mkv -> S06E07
Person.of.Interest_2011/Season_02/Person.of.Interest_S02E11_2πR_720p.HDTV.mkv -> S02E02
Person.of.Interest_2011/Season_03/Person.of.Interest_S03E13_4C_720p.HDTV.mkv -> S03E04
Person.of.Interest_2011/Season_05/Person.of.Interest_S05E04_6741_1080p.WEB.DL.mkv -> S05E6741
Person.of.Interest_2011/Season_05/Person.of.Interest_S05E04_6741_1080p.WEB.DL.mkv -> S05E1080
Person.of.Interest_2011/Season_05/Person.of.Interest_S05E12_exe_1080p.HDTV.mkv -> S05E1080
Rizzoli.and.Isles_2010/Season_07/Rizzoli.and.Isles_S07E08_2M7258.100_720p.HDTV.mkv -> S07E02
Rizzoli.and.Isles_2010/Season_07/Rizzoli.and.Isles_S07E09_65.Hours_720p.HDTV.mkv -> S07E65
Rules.Of.Engagement_2007/Season_04/Rules.of.Engagement_S04E06_3rd.Wheel_SDTV.avi -> S04E03
The.Newsroom_2012/Season_01/The.Newsroom.2012_S01E07_5.1_720p.HDTV.mkv -> S01E05
The.Wire_2002/Season_05/The.Wire_S05E10_30_720p.BluRay.mkv -> S05E30
The.Wire_2002/Season_05/The.Wire_S05E10_30_720p.BluRay.mkv -> S05E720
The.Simpsons_1989/Season_30/The.Simpsons_S30E15_101.Mitigations_720p.WEB.DL.mkv -> S30E101
The.Code_2019/Season_01/The.Code_S01E06_1st.Civ.Div_720p.HDTV.mkv -> S01E01
Better.Call.Saul_2015/Season_05/Better.Call.Saul_S05E02_50%.Off_1080p.WEB.DL.mkv -> S05E50
Tommy_2020/Season_01/Tommy_S01E04_19.Hour.Day_1080p.WEB.DL.mkv -> S01E19
Black-ish_2014/Season_01/black.ish_S01E17_30.Something_720p.HDTV.mkv -> S01E30
Black-ish_2014/Season_03/black.ish_S03E03_40.Acres.and.a.Vote_720p.HDTV.mkv -> S03E40
S.W.A.T_2017/Season_04/S.W.A.T.2017_S04E01_3.Seventeen.Year.Olds_720p.HDTV.mkv -> S04E03
Reply
#2
(2020-12-14, 12:42)triple89 Wrote: Can you enlighten me how to achieve this goal?

One way is to simply remove all the unnecessary crap in the filenames you have.
All metadata is stored in the Kodi database, such as video resolution and episode title.
Keeping your filenames simple will avoid having hiccups in scrapers.

Example: The.Resident_2018/Season_02/The.Resident_S02E01_004230_1080p.WEB.DL.mkv ==> The.Resident_S02E01.mkv

There are plenty of file renaming tools that can rename your folders in batches and clear stuff in no time. You will have to fully rescrape your TV show collection though.
Reply
#3
(2020-12-14, 13:01)Klojum Wrote: One way is to simply remove all the unnecessary crap in the filenames you have.
All metadata is stored in the Kodi database, such as video resolution and episode title.

Hi, thanks for the quick reply.
Indeed that would be an option, but I would rather be able to configure kodi to work properly. I am from time to time using the files on other machines without Kodi (or any other proper media center) installed, so having the title and quality in the filename is sometimes handy.
So yes it's the last resort, but I still hope there is a chance I can achieve my goal without it.
Reply
#4
If you want to keep the naming as it is then you'll have to learn regex and modify https://kodi.wiki/view/Advancedsettings....owmatching
Reply
#5
I finally got it to work, no idea what I did different this time compared to the last 3, but it worked with the following config:

  <tvshowmatching>
    <regexp>S([0-9]+)E([0-9]+)</regexp> <!-- foo.S01.E01 -->
  </tvshowmatching>

thanks for the help
Reply

Logout Mark Read Team Forum Stats Members Help
TV Show Matching matches too much - remove RegEx0