aboutsummaryrefslogtreecommitdiff
path: root/automedia.py
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-19 17:10:37 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:12:34 +0200
commit9c7191a16209497349fcc0b203e5aa1e67a79715 (patch)
treedf3f801f1a60b93d9b931b5c6d581d08f1c6520b /automedia.py
parentc941b54eb0ca7a1658f6658ebd4f5258d812d66b (diff)
Add sync date for series
Diffstat (limited to 'automedia.py')
-rwxr-xr-xautomedia.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/automedia.py b/automedia.py
index 214e53d..b31ddb8 100755
--- a/automedia.py
+++ b/automedia.py
@@ -471,6 +471,10 @@ def sync(rss_config_dir, html_config_dir, download_dir, sync_rate_sec):
latest = sync_rss(rss)
if latest:
rss_update_latest(rss_tracked_dir, rss, latest)
+ # Add last synced timestamp. This together with "updated" file is used to remove series
+ # that haven't updated in a long time (either finished series or axes series)
+ with open(os.path.join(rss_tracked_dir, rss.title, "synced"), "w") as file:
+ file.write(str(time.time()))
#else:
# print("No 'latest' item found for rss (maybe we already have the latest item?) %s" % rss.title)
#time.sleep(0.5) # Sleep between fetching rss so we don't get banned for spamming
@@ -481,6 +485,10 @@ def sync(rss_config_dir, html_config_dir, download_dir, sync_rate_sec):
latest = sync_html(html, download_dir, session_id)
if latest:
html_update_latest(html_tracked_dir, html, latest)
+ # Add last synced timestamp. This together with "updated" file is used to remove series
+ # that haven't updated in a long time (either finished series or axes series)
+ with open(os.path.join(html_tracked_dir, html.title, "synced"), "w") as file:
+ file.write(str(time.time()))
#else:
# print("No 'latest' item found for html (maybe we already have the latest item?) %s" % html.title)
#time.sleep(0.5) # Sleep between fetching html so we don't get banned for spamming