aboutsummaryrefslogtreecommitdiff
path: root/pl/local_episodes.pl
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-05-26 22:59:28 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-05-26 22:59:28 +0200
commitb1b296dbd1b36c0033ffc8aff832e7b2ff49c5cc (patch)
tree29d427584c47030c8c4e325e1c7ee2428fe18bb7 /pl/local_episodes.pl
parent2b750824f9d2ad871e970c70fa49a500f72d3f3c (diff)
downloadEpisodeBrowser-b1b296dbd1b36c0033ffc8aff832e7b2ff49c5cc.tar.gz
Support padded episode numbers in local episode names.
Diffstat (limited to 'pl/local_episodes.pl')
-rw-r--r--pl/local_episodes.pl10
1 files changed, 8 insertions, 2 deletions
diff --git a/pl/local_episodes.pl b/pl/local_episodes.pl
index 935e3b7..0273bb3 100644
--- a/pl/local_episodes.pl
+++ b/pl/local_episodes.pl
@@ -14,12 +14,18 @@ local_episode_prefix --> string(_), "detective_conan_".
nondigit --> [C], !, { \+ code_type(C, digit) }.
nondigit --> [].
+zeroes --> "0".
+zeroes --> "0", zeroes.
+
+paddedint(N) --> integer(N).
+paddedint(N) --> zeroes, integer(N).
+
local_episode -->
local_episode(_).
local_episode(N) -->
- local_episode_prefix, integer(N), nondigit, string(_).
+ local_episode_prefix, paddedint(N), nondigit, string(_).
local_episode(N) -->
- local_episode_prefix, integer(First), "-", integer(Last), nondigit, string(_),
+ local_episode_prefix, paddedint(First), "-", paddedint(Last), nondigit, string(_),
{ Second is First + 1, between(Second, Last, N) }.
% Find episode on disk.