From: Mark Wooding Date: Thu, 17 Mar 2022 16:17:11 +0000 (+0000) Subject: mkm3u: Add `!displaced' command to handle using special versions of episodes. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/epls/commitdiff_plain/0c4ca4f3e3b627849cda630e7e6bff70a133e11e mkm3u: Add `!displaced' command to handle using special versions of episodes. That is, we use the fancy `extended' version of an episode from a different disc. This just compensates the disc-episode accounting. --- diff --git a/mkm3u b/mkm3u index 27907cd..7cf240c 100755 --- a/mkm3u +++ b/mkm3u @@ -509,6 +509,20 @@ class EpisodeListParser (object): if dir == "-": forget(me._audirs, name) else: me._audirs[name] = AudioDir(dir) + elif cmd == "displaced": + series, name = me._opts_series(cmd, opts) + w = ww.rest(); check(w is not None, "missing count"); n = getint(w) + check(name not in me._isos, "iso file active") + season = series.ensure_season() + check(season.i is not None, "movie season active") + dir = lookup(me._vdirs, name, "no active video directory") + vseason = lookup(dir.seasons, season.i, + "season %d not found in video dir `%s'" % + (season.i, dir.dir)) + src = lookup(vseason.episodes, season.ep_i, + "episode %d.%d not found in video dir `%s'" % + (season.i, season.ep_i, dir.dir)) + src.nuses += n else: raise ExpectedError("unknown command `%s'" % cmd)