only get current year by default
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import html
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from playwright.sync_api import sync_playwright, Page, BrowserContext
|
||||
@@ -369,6 +371,11 @@ def download_all_invoices() -> list[Path]:
|
||||
years = get_year_options(page)
|
||||
if not years:
|
||||
years = ["all"]
|
||||
else:
|
||||
download_all_years = os.getenv("DOWNLOAD_ALL_YEARS", "").lower() in ("1", "true", "yes", "y")
|
||||
if not download_all_years:
|
||||
current_year = str(datetime.now().year)
|
||||
years = [current_year] if current_year in years else years[:1]
|
||||
logger.info("Group '%s' - years: %s", group["label"], years)
|
||||
|
||||
for year in years:
|
||||
|
||||
Reference in New Issue
Block a user