mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-21 15:36:18 -05:00
Repair Archive download datetimes misread from a SingleFile saved date
Archives parsed before the offset fix keep the shifted download_datetime, because the parser only fills an empty value. A one-time background repair (gated by a wrolpi_kv version, after the first refresh) re-reads each Archive's saved date and corrects a download_datetime that equals the offset-dropped value. Any other download_datetime is left alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3c07704b9b
commit
afd8f157c6
4 changed files with 126 additions and 11 deletions
14
main.py
14
main.py
|
|
@ -423,6 +423,20 @@ async def perpetual_start_video_missing_comments_download():
|
|||
logger.debug('Waiting for downloads to be enabled before downloading comments...')
|
||||
|
||||
|
||||
@perpetual_signal(sleep=3600)
|
||||
async def perpetual_repair_archive_saved_dates():
|
||||
"""Correct Archive download datetimes that were misread from their SingleFile saved date. Runs once."""
|
||||
async with flags.refresh_complete.wait_for():
|
||||
# Archives must be in the database.
|
||||
pass
|
||||
|
||||
from modules.archive.lib import repair_singlefile_saved_dates
|
||||
try:
|
||||
await asyncio.to_thread(repair_singlefile_saved_dates)
|
||||
except Exception as e:
|
||||
logger.error('Failed to repair Archive download datetimes', exc_info=e)
|
||||
|
||||
|
||||
@perpetual_signal(sleep=3600) # Check hourly
|
||||
async def perpetual_check_for_updates():
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue