Skip to content

Commit

Permalink
fix: make it check the last 7 days (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare authored May 19, 2023
1 parent 17ecfa7 commit e949dac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def check(oc: OwnCloudClient, oc_path: str) -> list[datetime]:
Checks ownCloud for missing files.
"""
missing = []
start = datetime(2023, 1, 1)
start = datetime.now() - timedelta(7)
for requested in tqdm(daterange(start, datetime.now()), desc="Checking ownCloud"):
oc_mkdir(oc, oc_path)
oc_mkdir(oc, os.path.join(oc_path, str(requested.year)))
Expand Down Expand Up @@ -163,7 +163,7 @@ def main(): # pragma: no cover
# figure out what we are missing on ownCloud
oc = OwnCloudClient(options.oc_url)
oc.login(options.oc_user, options.oc_pass)
missing = check(oc=oc, start=datetime(2023, 1, 1), oc_path=options.oc_path)
missing = check(oc=oc, oc_path=options.oc_path)

# return early if no files are missing
if not missing:
Expand Down

0 comments on commit e949dac

Please sign in to comment.