Conversation
|
@bbutlerau |
The standalone convert utility converts a tracked file, moves the original to trash and leaves the LibraryFile row on the old path. The record then references a file that no longer exists, the converted file is untracked, and later utilities cannot find metadata for it (Mass Convert reports "No metadata available from unknown"). Update the record after a completed conversion, as the mass convert pipeline already does, and point it back on rollback. The shared sync helper now takes the format from the target path so a rollback to a CBR is not recorded as CBZ. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E9gUFQEryh4gDJRKvjNUZM
A CBZ -> CBZ repack keeps the file name but rewrites the archive, and the sync skipped it because the path had not changed, leaving the old size, modified time and cached hash on the record. The record is now refreshed whenever a conversion or its rollback completes, whether or not the path moved; the shared helper already clears the cached hash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E9gUFQEryh4gDJRKvjNUZM
814592a to
791b7af
Compare
|
Thanks, good catch on the same-path repack. Updated:
The same-path fix is in a separate commit on top (791b7af). |
Summary
The standalone Convert utility (
file_convert) converts a tracked file, moves the original to trash, and leaves theLibraryFilerow on the old path. Afterwards:.cbzis untracked;No metadata available from unknown for <file>, skipping step 2.I hit this converting six
.cbrissues of one series; the records stayed on the.cbrpaths and I had to repoint them by hand. The Mass Convert pipeline already syncs the record inapply_item_result; the standalone executor had no equivalent.Related Issues
None filed.
Changes
FileConverterExecutor.apply_item_result: after a completed conversion, move the tracked record to the converted path (name, format, size, modified time), via the existing_sync_converted_file_recordhelper. Untracked files and failed items are left alone.FileConverterExecutor.apply_rollback_result: after a successful rollback, point the record back at the restored original. The rollback executor already looks this hook up on the original executor._sync_converted_file_recordnow takes the format from the target path's suffix instead of always writingCBZ, so a rollback to a.cbris not recorded as CBZ. Conversions still produce CBZ, so forward behaviour is unchanged. This also corrects the same case for Mass Convert rollbacks, which use the helper.Checklist
tests/utilities/test_file_converter.py,test_mass_convert_pipeline.py,test_error_recovery.py,tests/unit/test_library_convert_service.py,test_referenced_utility_guards.py, and the rollback tests). The new record-sync tests fail ondevelopwithout the change.ruff check src/ tests/)mypy --strictonfile_converter.pyandlibrary_convert_service.py). A full-tree run in my environment reports errors on untoucheddeveloptoo, so I am relying on CI for the full check.ruff format --check src/ tests/)CHANGELOG.mdupdated: left for release prep, per the contributing guideScreenshots
No UI changes.
🤖 Generated with Claude Code