chiark
/
gitweb
/
~mdw
/
epls
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
065a5db
)
mkm3u: Teach video parser to handle single-episode discs with titles.
author
Mark Wooding
<mdw@distorted.org.uk>
Mon, 14 Mar 2022 18:29:06 +0000
(18:29 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Mon, 14 Mar 2022 20:06:40 +0000
(20:06 +0000)
mkm3u
patch
|
blob
|
blame
|
history
diff --git
a/mkm3u
b/mkm3u
index bcc3536a4ab7457bc7805f27123b93df2c97b828..9fdc90fb99b59ec7899184717def26457cb1ef7f 100755
(executable)
--- a/
mkm3u
+++ b/
mkm3u
@@
-139,10
+139,16
@@
def some_group(m, *gg):
class VideoDir (object):
_R_ISO_PRE = RX.compile(r""" ^
class VideoDir (object):
_R_ISO_PRE = RX.compile(r""" ^
- (?: S (?P<si> \d+) (?: \. \ (?P<st> .*)—)? (?: D (?P<sdi> \d+))? |
- (?P<di> \d+))
- \. \ #
- (?P<eps> .*)
+ (?: S (?P<si> \d+)
+ (?: \. \ (?P<st> .*) — (?: D \d+ \. \ )? |
+ D \d+ \. \ |
+ (?= E \d+ \. \ ) |
+ \. \ ) |
+ \d+ \. \ )
+ (?: (?P<eplist>
+ (?: S \d+ \ )? E \d+ (?: – \d+)?
+ (?: , \ (?: S \d+ \ )? E \d+ (?: – \d+)?)*) |
+ (?P<epname> E \d+) \. \ .*)
\. iso $
""", RX.X)
\. iso $
""", RX.X)
@@
-183,7
+189,10
@@
class VideoDir (object):
disc = VideoDisc(path)
ts = season
any, bad = False, False
disc = VideoDisc(path)
ts = season
any, bad = False, False
- for eprange in m.group("eps").split(", "):
+ epname = m.group("epname")
+ if epname is not None: eplist = [epname]
+ else: eplist = m.group("eplist").split(", ")
+ for eprange in eplist:
mm = me._R_ISO_EP.match(eprange)
if mm is None: bad = True; continue
if not any:
mm = me._R_ISO_EP.match(eprange)
if mm is None: bad = True; continue
if not any: