Add read-only library flag to block tag writes#787
Merged
Conversation
Mark a Library read_only to protect its comics from all archive-mutating operations (Edit Tags + Tag Online). Enforced server-side at the single resolve_comic_pks funnel and again at the task executors; mixed selections write only editable comics and report a skipped count. The metadata payload gains an `editable` aggregate that hides the edit/tag buttons when nothing in the selection is writable. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The edit dialog bound :label="updateLabel", but updateLabel was never defined on the component, so Vue warned on every render once a library row existed. The dialog's label prop already falls back to the table name, so drop the broken binding. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
read_onlyboolean flag to libraries. Comics in a read-only library are protected from every archive-mutating operation — Edit Tags and Tag Online — while still importing, polling, generating covers, and tracking bookmarks normally.Why
Some libraries should never have their comic files modified: shared/curated collections, read-only mounts, or archives the user simply doesn't want touched. Today any admin can write tags into any comic.
How it works
Library.read_only(BooleanField(db_index=True, default=False)), migration0045. Editable in the admin Libraries form/table.FilteredComicPksView.resolve_comic_pks(shared by tag-write, online-tag, preflight, tag-by-id) now dropslibrary__read_only=Truecomics and reports how many were skipped. No read-only comic is ever enqueued for a write, regardless of the UI.tag_writer,onlinetag/session_manager) also exclude read-only comics, so a hand-crafted task can't slip through.editableaggregate (true when any selected comic is in a writable library); the Edit Tags / Tag Online entry points hide when it's false. Covers the reader too (same dialog).Reviewer notes
tests/test_read_only_library.py(7) cover the funnel exclusion, the reportedskippedcount, the all-read-only rejection, and the metadataeditableaggregate (writable / read-only / mixed). Existing tag-write, online-tag, and metadata suites pass unchanged.Property "updateLabel" was accessed during render but is not definedVue warning in the admin library table (dropped a dead:labelbinding).🤖 Generated with Claude Code