BUG Problematic handling of RegEx expression in AdvancedSettings.cpp

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Sesshoumaru Offline
Junior Member
Posts: 11
Joined: May 2013
Reputation: 1
Post: #1
Hello

I have issues with some regular expressions that are used for recognition of season and episode numbers from TV series.
An expression that works fine within a standalone RegEx checker fail in XBMC. I decided to build XBMC to debug the complete handling.

Due to the investigation I found the rootcause in the AdvancedSettings.cpp in the code that reads the expression from the XML file.
After the expression is read from XML in the method GetCustomTVRegexps [line: 1193] the following code is executed:

Code:
CStdString regExp = pRegExp->FirstChild()->Value();
regExp.MakeLower();

This is not very good for regular expression as e.g. (\d+) means something different than (\D+). Some of my expressions fail because of this. I would suggest to remove the MakeLower() call from this method.

If nobody objects I would like to create an official bug in TRAC and I would be also willing to fix it. Its a very small fix, so if anybody works on that file it would be nice to just fix it as well Smile


Thanks.
(This post was last modified: 2013-06-08 19:37 by Sesshoumaru.)
find quote
pieh Offline
Team-XBMC Member
Posts: 672
Joined: Aug 2010
Reputation: 13
Location: Poland
Post: #2
Hi,
I went ahead and created pull request https://github.com/xbmc/xbmc/pull/2851 Wink

Nice find!

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

My previous forum/trac nickname: grajen3
find quote
Sesshoumaru Offline
Junior Member
Posts: 11
Joined: May 2013
Reputation: 1
Post: #3
No objections from my side Cool
I created a regular expression that is able to handle season and episode number extraction in nearly 99% of all anime files nowadays (tested with about 20.000 episodes) and its a pity that it does not work correctly because of this issue.
find quote
pieh Offline
Team-XBMC Member
Posts: 672
Joined: Aug 2010
Reputation: 13
Location: Poland
Post: #4
Aaaaaaand merged. Thanks for this very detailed bug report!

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

My previous forum/trac nickname: grajen3
find quote