wrolpi/modules
Roland 9cc5c15e32 fix: coerce sleep_requests and numeric settings from string form values
`sleep_requests` (and other numeric inheritable video download settings)
could arrive as strings ('' or '0.75') from the frontend NumberInputForm
and DownloadRequest bodies. These were persisted into Download.settings
(JSONB) and later triggered:

    if effective['sleep_requests'] > 0:
    TypeError: '>' not supported between instances of 'str' and 'int'

in VideoDownloader.execute_download (and similar sites).

Root cause: DownloadSettings.__post_init__ only filtered None/[] and did
no type coercion, even though the dataclass declared Optional[float]/int.

Changes (minimal targeted fix):
- Add _coerce_optional_number helper and apply it to all numeric fields
  in DownloadSettings.__post_init__ (the existing sanitization boundary).
- Centralize legacy string coercion for persisted data in the single
  read chokepoint: get_effective_video_settings.
- Simplify VideoDownloaderConfig.sleep_requests getter.
- Frontend: use parseFloat for type=number inputs + null defaults for
  sleep_requests (prevents '' from ever being submitted).
- Add focused regression test for string coercion path.
- Revert unrelated change to string field filtering behavior.

No NaN/Inf speculation, no duplicated try/float guards at every call site,
no behavior change for non-numeric settings.
2026-05-31 13:02:31 -06:00
..
archive Converting RSS and Video Downloaders to new testable strategy. 2026-05-07 20:07:31 -06:00
docs Consolidating deletion endpoints. 2026-05-03 19:14:30 -06:00
inventory Backup configs can be restored in the UI. User can choose between Merge or Overwrite, the UI displays a comparison. Configs are compared when user opens the restore modal, configs which won't cause changes are marked. 2026-03-10 20:30:46 -06:00
map Migrating map downloaders. 2026-05-07 15:54:53 -06:00
otp Creating a new Collection model for use in organizing FileGroups. 2025-12-06 15:11:37 -07:00
videos fix: coerce sleep_requests and numeric settings from string form values 2026-05-31 13:02:31 -06:00
zim Fixing kiwix restart cmd: missing comma silently concatenated two argv entries. 2026-05-25 20:16:02 -06:00
__init__.py Add Docs module for searching and organizing PDFs and EPUBs 2026-03-20 14:17:06 -06:00