[service.libraryautoupdate] 1.2.6 - #2891
Conversation
|
| Filename | Overview |
|---|---|
| service.libraryautoupdate/resources/lib/cronclasses.py | Adds a required CronSchedule constructor but leaves the live custom-path factory using parameterless construction. |
| service.libraryautoupdate/resources/lib/service.py | Refactors schedule creation and cron validation but introduces an uninitialized cleaning command and removes fallback handling from unvalidated expression paths. |
| service.libraryautoupdate/resources/settings.xml | Corrects the cleaning-library default to numeric option 0 and changes category identifiers without an identified defect. |
| service.libraryautoupdate/addon.xml | Bumps the release version and updates release notes and Swedish metadata. |
| service.libraryautoupdate/resources/language/resource.language.sv_se/strings.po | Refreshes Swedish translations and catalog metadata without affecting runtime logic. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Kodi service initialization] --> B[Create standard schedules]
B --> C[Load custom-path schedules]
C -->|CronSchedule without arguments| D[TypeError]
B --> E[Calculate next run]
E -->|Unvalidated clean/custom expression| F[Uncaught croniter error]
G[Library scan finishes] --> H[databaseUpdated]
H -->|Completed library excluded from cleaning| I[clean_command uninitialized]
I --> J[UnboundLocalError]
Reviews (1): Last reviewed commit: "[service.libraryautoupdate] 1.2.6" | Re-trigger Greptile
| next_run = 0 | ||
| on_delay = False # used to defer processing until after player finishes | ||
|
|
||
| def __init__(self, name, command, expression=""): |
There was a problem hiding this comment.
| aJob.command = {'method': 'AudioLibrary.Clean', 'params': {'showdialogs': showDialogs}} | ||
| clean_command = {'method': 'AudioLibrary.Clean', 'params': {'showdialogs': showDialogs}} | ||
|
|
||
| aJob = CronSchedule(utils.getString(30048), clean_command) |
There was a problem hiding this comment.
Cleaning command remains uninitialized
When cleaning after each update is limited to one library and a scan of the excluded library finishes, neither branch initializes clean_command, but the code uses it unconditionally, causing UnboundLocalError and aborting the post-scan callback instead of skipping that library.
| cron = croniter(cronExp, startTime) | ||
|
|
||
| try: | ||
| # create croniter for this expression | ||
| cron = croniter(cronExp, startTime) | ||
| nextRun = cron.get_next(float) | ||
| except ValueError: | ||
| # error in syntax | ||
| xbmcgui.Dialog().ok(utils.getString(30000), utils.getString(30016) % cronExp) | ||
| utils.log('Cron syntax error %s' % cronExp, xbmc.LOGDEBUG) | ||
| return cron.get_next(float) |
There was a problem hiding this comment.
Unvalidated schedules lose fallback
When a saved cleaning or custom-path cron expression is malformed, it reaches calcNextRun without passing through checkTimer; removing the previous ValueError fallback lets croniter terminate schedule creation or timer recalculation and can stop the auto-update service.
Description
Changed
Fixed
KeyErrorduring cron expression checkingsettings.xmlfile for Clean Library function, resulted in looping behavior fixesChecklist:
Additional information :