diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-24 15:17:08 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-24 15:17:33 +0200 |
commit | 6fd66a9264731bd7ee6d7602675965021d929a4a (patch) | |
tree | e94fc63efb823ad2f5c9ef6de6188da389a08d38 /pl/local_episodes.pl | |
parent | ff48d644a45dd71098ecb9007a41807fb37d0081 (diff) | |
download | EpisodeBrowser-6fd66a9264731bd7ee6d7602675965021d929a4a.tar.gz |
Remove Prolog dependency.
The only thing left to reimplement is the tracking of watched episodes
in MPC-HC.
Diffstat (limited to 'pl/local_episodes.pl')
-rw-r--r-- | pl/local_episodes.pl | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/pl/local_episodes.pl b/pl/local_episodes.pl deleted file mode 100644 index 68809a7..0000000 --- a/pl/local_episodes.pl +++ /dev/null @@ -1,50 +0,0 @@ -:- module(local_episodes, [local_episode//1, - episode_file/2, - open_episode_locally/1, - open_episode_online/1]). - -:- use_module(library(dcg/basics)). -:- use_module(atom_dcg). -:- use_module(cfg). - -local_episode_prefix --> string(_), "Detective_Conan_-_". -local_episode_prefix --> string(_), "Detective Conan - ". -local_episode_prefix --> string(_), "Detective-Conan-". -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, paddedint(N), nondigit, string(_). -local_episode(N) --> - local_episode_prefix, paddedint(First), "-", paddedint(Last), nondigit, string(_), - { Second is First + 1, between(Second, Last, N) }. - -% Find episode on disk. - -episode_file(N, F) :- - get_root(R), - get_glob(G), - atomic_list_concat([R, '/', G], G1), - expand_file_name(G1, F1), - ( nonvar(N) - -> include(atom_phrase(local_episode(N)), F1, [F|_]) - ; include(atom_phrase(local_episode), F1, F2), - member(F, F2), - atom_phrase(local_episode(N), F) - ). - -% Open episode. - -episode_url(N) --> { with_codes(get_url(U)) }, string(U), integer(N). -open_episode_locally(N) :- episode_file(N, F), !, win_shell(open, F). -open_episode_online(N) :- atom_phrase(episode_url(N), U), win_shell(open, U). |