Skip to content

Commit

Permalink
Download since last second: the first test of new solution
Browse files Browse the repository at this point in the history
  • Loading branch information
dplocki committed May 12, 2024
1 parent 7b38b1e commit 8cfde98
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions podcast_downloader/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def load_the_last_run_date_store_now(marker_file_path, now):
if marker_file_path == None:
return None

if os.path.exists(marker_file_path):
if not os.path.exists(marker_file_path):
logger.warning("Marker file doesn't exist, creating (set last time run as now)")

with open(marker_file_path, "w") as file:
Expand All @@ -174,8 +174,11 @@ def load_the_last_run_date_store_now(marker_file_path, now):

return now

access_time = os.path.getatime(marker_file_path)
os.utime(marker_file_path, (now, now))
access_time = time.gmtime(os.path.getatime(marker_file_path))

logger.info('Last time the script has been run: %s', time.strftime("%Y-%m-%d %H:%M:%S", access_time))

os.utime(marker_file_path, times=(time.mktime(now), time.mktime(now)))
return access_time


Expand Down

0 comments on commit 8cfde98

Please sign in to comment.