diff --git a/VERSION b/VERSION index 13945a37..60ff0f21 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.5-develop89 +1.16.5-develop90 diff --git a/config/config.yml.template b/config/config.yml.template index a6103487..1ab69782 100644 --- a/config/config.yml.template +++ b/config/config.yml.template @@ -30,6 +30,7 @@ settings: asset_folders: true asset_depth: 0 create_asset_folders: false + prioritize_assets: false dimensional_asset_rename: false download_url_assets: false show_missing_season_assets: false @@ -48,14 +49,16 @@ settings: show_options: false show_missing: true show_missing_assets: true - save_missing: true + save_report: false tvdb_language: eng ignore_ids: ignore_imdb_ids: item_refresh_delay: 0 playlist_sync_to_user: all + playlist_report: false verify_ssl: true custom_repo: + check_nightly: false webhooks: # Can be individually specified per library as well error: version: diff --git a/docs/metadata/details/schedule.md b/docs/metadata/details/schedule.md index c624e619..de5c0d43 100644 --- a/docs/metadata/details/schedule.md +++ b/docs/metadata/details/schedule.md @@ -52,7 +52,9 @@ collections: TMDb Top Rated: tmdb_top_rated: 30 sync_mode: sync - schedule: monthly(1), monthly(15) + schedule: + - monthly(1) + - monthly(15) ``` Below is an example of a scheduled pinning collection: @@ -66,18 +68,18 @@ collections: The scheduling options are: -| Name | Description | Format | Example | -|:--------|:-----------------------------------------------------------------------------------------------------|:----------------------|:---------------------| -| Hourly | Update only when the script is run in that hour | hourly(Hour of Day) | `hourly(17)` | -| Daily | Update once a day | daily | `daily` | -| Weekly | Update once a week on the specified day | weekly(Day of Week) | `weekly(sunday)` | -| Monthly | Update once a month on the specified day | monthly(Day of Month) | `monthly(1)` | -| Yearly | Update once a year on the specified day | yearly(MM/DD) | `yearly(01/30)` | -| Range | Updates whenever the date is within the range | range(MM/DD-MM/DD) | `range(12/01-12/31)` | -| Never | Never updates | never | `never` | -| All | Requires that all scheduling option be meet in order to run
ex. `all, weekly(sunday), hourly(17)` | all | `all` | +| Name | Description | Format | Example | +|:--------|:-------------------------------------------------------------------------------------------------|:----------------------|:----------------------------------| +| Hourly | Update only when the script is run in that hour | hourly(Hour of Day) | `hourly(17)` | +| Daily | Update once a day | daily | `daily` | +| Weekly | Update once a week on the specified day | weekly(Day of Week) | `weekly(sunday)` | +| Monthly | Update once a month on the specified day | monthly(Day of Month) | `monthly(1)` | +| Yearly | Update once a year on the specified day | yearly(MM/DD) | `yearly(01/30)` | +| Range | Updates whenever the date is within the range | range(MM/DD-MM/DD) | `range(12/01-12/31)` | +| Never | Never updates | never | `never` | +| All | Requires that all comma separated scheduling options inside its brackets be meet in order to run | all[Options] | `all[weekly(sunday), hourly(17)]` | * `daily` is the default when `schedule` isn't specified. * You can run the script multiple times per day but using the `--time` command line argument detailed on the [Run Commands & Environmental Variables Page](../../home/environmental.md#time-to-run). -* You can have multiple scheduling options just make them a list or comma-separated values. -* You can use the `delete_not_scheduled` setting to delete Collections that are skipped due to not being scheduled. \ No newline at end of file +* You can have multiple scheduling options as a list. +* You can use the `delete_not_scheduled` setting to delete Collections that are skipped due to not being scheduled. diff --git a/modules/util.py b/modules/util.py index 48eb2e09..9697978e 100644 --- a/modules/util.py +++ b/modules/util.py @@ -513,21 +513,31 @@ def check_day(_m, _d): else: return _m, _d -def schedule_check(attribute, data, current_time, run_hour): +def schedule_check(attribute, data, current_time, run_hour, is_all=False): range_collection = False all_check = 0 schedules_run = 0 - is_all = False next_month = current_time.replace(day=28) + timedelta(days=4) last_day = next_month - timedelta(days=next_month.day) schedule_str = "" + if isinstance(data, str) and (("all" in data and not data.endswith("]")) or data.count("all") > 1): + raise Failed("Schedule Error: each all schedule must be on its own line") + elif isinstance(data, str) and "all" in data: + data = [data] for schedule in get_list(data): run_time = str(schedule).lower() display = f"{attribute} attribute {schedule} invalid" schedules_run += 1 - if run_time == "all": - is_all = True - all_check += 1 + if run_time.startswith("all"): + match = re.search("\\[([^\\]]+)\\]", run_time) + if not match: + logger.error(f"Schedule Error: failed to parse {attribute}: {schedule}") + continue + try: + schedule_check(attribute, match.group(1), current_time, run_hour, is_all=True) + all_check += 1 + except NotScheduled: + continue elif run_time.startswith(("day", "daily")): all_check += 1 elif run_time == "never": @@ -598,7 +608,7 @@ def schedule_check(attribute, data, current_time, run_hour): all_check += 1 else: logger.error(f"Schedule Error: {display}") - if all_check == 0 or (is_all and schedules_run != all_check): + if (all_check == 0 and not is_all) or (is_all and schedules_run != all_check): if range_collection: raise NotScheduledRange(schedule_str) else: