diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-02-02 00:56:52 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:12:34 +0200 |
commit | c7520a0d26ba18dfb240258dc1ec8cf4913a291a (patch) | |
tree | 8958db0e7f0da7b4a094ee8a222f97d69a177239 | |
parent | d1369b4ee1bdce45b903e99e413f3feec1ecc364 (diff) |
Ignore in progress media for open media script
-rw-r--r-- | README.md | 4 | ||||
-rwxr-xr-x | automedia.py | 4 | ||||
-rwxr-xr-x | open_media.py | 7 | ||||
-rw-r--r-- | requirements.txt | 1 |
4 files changed, 11 insertions, 5 deletions
@@ -9,9 +9,9 @@ Run automedia without any options to see all options. 2. Automatically remove torrents that have finished seeding, to reduce memory usage and startup time of transmission. # Requirements ## System -transmission-cli, notify-send (optional) +wget, transmission-cli, notify-send (optional) ## Python -feedparser, transmissionrpc +feedparser, transmissionrpc, lxml # Requirements when using read_manga.py ## System rofi, sxiv diff --git a/automedia.py b/automedia.py index 2d8f300..e319f47 100755 --- a/automedia.py +++ b/automedia.py @@ -505,8 +505,8 @@ def resume_tracked_html(plugin_entry, download_dir, tracked_html, session_id): invalid_session = True if invalid_session: - if not only_show_finished_notification: - show_notification("Resuming", "Resuming download for item {} with plugin {}".format(item, tracked_html.plugin)) + #if not only_show_finished_notification: + show_notification("Resuming", "Resuming download for item {} with plugin {}".format(os.path.join(tracked_html.title, item), tracked_html.plugin)) with open(os.path.join(item_dir, ".session_id"), "w") as file: file.write(session_id) plugin_download(plugin_entry, url, item_dir) diff --git a/open_media.py b/open_media.py index 6073782..6328b16 100755 --- a/open_media.py +++ b/open_media.py @@ -48,7 +48,12 @@ def main(): exit(2) downloaded_list = get_downloaded_list() - downloaded_list = [item for item in downloaded_list if os.path.exists(os.path.join(download_dir, item))] + filtered_downloaded_list = [] + for item in downloaded_list: + media_path = os.path.join(download_dir, item) + if os.path.exists(media_path) and not os.path.exists(os.path.join(media_path, ".in_progress")): + filtered_downloaded_list.append(item) + downloaded_list = filtered_downloaded_list seen_filepath = os.path.expanduser("~/.config/automedia/seen") seen_list = [] diff --git a/requirements.txt b/requirements.txt index 2951ed3..b1d48ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ feedparser transmissionrpc +lxml |