Jump to content

Smart Match regex syntax


Tuxedo
Go to solution Solved by softworkz,

Recommended Posts

Tuxedo

@@softworkz I'm having trouble importing episodes of The 100 that were named by Emby.

 

  1. I start off with this, which gets moved into the auto-organize watched folder:
    • The.100.S03E10.720p.HDTV.x264.mkv
  2. Emby correctly organizes it into the folder The 100 (2014)/Season 3 with the name:
    • The 100 - 3x10 - Fallen.mkv
  3. At night, a separate process will delete the organized file after it's put a recompressed copy of it in the watched folder, named similarly:
    • The 100 - 3x10 - Fallen.mp4
  4. After the library scan notices the organized episode was removed, the recompressed versions of other shows get auto-organized, but episodes of The 100 always fail at this point.

My autoorganize.xml contains this entry, which I had to create by hand because the Organize File dialog never offered the option to create one for this show.

    <SmartMatchInfo>
      <ItemName>The 100</ItemName>
      <DisplayName>The 100</DisplayName>
      <OrganizerType>Episode</OrganizerType>
      <MatchStrings>
        <string>The.100</string>
        <string>The.100.-</string>
        <string>The 100</string>
        <string>The 100 -</string>
      </MatchStrings>
    </SmartMatchInfo>

The initially downloaded files match with no problem, but then after the rename they don't. From the logs I see this:

2016-04-13 16:29:46.8136 Info App: Sorting file /Volumes/Drobo/Finished/replacements/The 100 - 3x10 - Fallen.mp4
2016-04-13 16:29:46.8606 Debug App: Extracted information from /Volumes/Drobo/Finished/replacements/The 100 - 3x10 - Fallen.mp4. Series name The, Season 3, Episode 10
2016-04-13 16:29:46.8973 Warn App: Unable to find series in library matching name The

Are the strings in MatchStrings supposed to be regexes or just string literals? I haven't been able to track down that code. The first case worked for the pre-organized filename, but not the organized names making me think they're not regexes, but then what I've done since apparently isn't working either.

 

I've figured out that changes to the autoorganize.xml file aren't picked up until after I restart the server, so that's not the issue.

Link to comment
Share on other sites

  • Solution

@@softworkz I'm having trouble importing episodes of The 100 that were named by Emby..

 

First, smart match does not use any regex matching, not even substring matching, instead it uses exact matching.

(I have explained the reasons for this in some post on github)

 

But it doesn't match against the filename, it matches against the "extracted series name". This  "extracted series name" in turn is extracted from the file name by Emby via regex parsing (alongside with year, season and episode number).

 

In your example, the "extracted series name" is "The" (and not "The 100"). Probably 100 is detected as some other data.

For smart matching we/I decided require at least 4 letters. This is why the smart match checkbox is not displayed.

 

The case you are describing is one that slips through the implemented logic.

 

Though, you should be able to fix it by adding "The" as a smart match string, but in this case you would take the risk that other series named "The" followed by a number (like "The 99") would be organized as "The 100".

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...