[mythtv] [mythtv-commits] Ticket #6943: Mythvideo filename parsing

Mythtv mythtv at meric.id.au
Mon Aug 31 03:24:25 UTC 2009


Ah... didn't see that.

How about this for an option then:
*** mythvideo/mythvideo/metadata.cpp.orig       Sun Aug 30 12:31:59 2009
--- mythvideo/mythvideo/metadata.cpp    Mon Aug 31 11:58:02 2009
***************
*** 873,879 ****
      QString regexp = QString(
                    "^(.*[^s0-9])" // Title
                    "%1" // optional separator
!                   "(?:s|(?:%2))?" // season marker
                    "%1" // optional separator
                    "(\\d{1,3})" // Season
                    "%1" // optional separator
--- 873,879 ----
      QString regexp = QString(
                    "^(.*[^s0-9])" // Title
                    "%1" // optional separator
!                   "(?:[s/ ]|%2)" // season marker
                    "%1" // optional separator
                    "(\\d{1,3})" // Season
                    "%1" // optional separator

I think it covers all the issues.  The idea is to make the season marker
compulsory, but to allow all the standard separators.  I've also removed
the redundant non-capture declaration.

-----Original Message-----
From: Michael T. Dean [mailto:mtdean at thirdcontact.com] 
Sent: Monday, 31 August 2009 5:47 AM
To: mythtv-dev at mythtv.org
Subject: Re: [mythtv-commits] Ticket #6943: Mythvideo filename parsing

On 08/30/2009 03:24 AM, MythTV wrote:
> #6943: Mythvideo filename parsing
>
>  Refers to ticket 6942 (closed).
>  I really hate creating a duplicate ticket, but I wasn't really given
a
>  choice in the matter.
>
>  The suggested fix (which I've now attached) doesn't break existing
>  functionality as the redundent space in the episode marker pattern is
>  handled equally well by the generic seperator pattern.

FWIW, the suggested fix /does/ break pattern matching for some of the 
previously-allowed formats.  The space was allowing all of space, 
period, dash, and underscore (as the others are replaced with spaces 
before the pattern matching).

So, before the change, the following were valid formats:

Lost-1-1-Pilot.mpg
Lost_1_1_Pilot.mpg
Lost_1-1_Pilot.mpg
Lost.1.1.Pilot.mpg
Lost 1 1 Pilot.mpg

The reason the fix is changing the behavior--even though the optional 
separator allows a space--is because the optional separator is, er, 
optional, but the episode separator is mandatory.  Therefore, removing 
space from the list of valid episode separators, means that /only/ e, x,

and episode are valid episode separators.

However, Robert decided that it would likely be easier for users to 
understand why some formats fail if he just limited the list of valid 
episode separators to e, x, and episode, and no longer allowed space, 
period, dash, and underscore.

Mike


More information about the mythtv-dev mailing list