Book moves: auto-create the leaf destination category (sub-category)#92
Open
Y-PLONI wants to merge 1 commit into
Open
Book moves: auto-create the leaf destination category (sub-category)#92Y-PLONI wants to merge 1 commit into
Y-PLONI wants to merge 1 commit into
Conversation
Contributor
Author
|
@kdroidFilter הקומיט הזה נועד להוסיף קטגוריה כשרשימת ההחלפות מעבירה למיקום שלא קיים. אם תבחר שלא לקבל את הPR, אני פשוט אשכפל את הקובץ: אשמח לתגובה! |
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
Book moves (
book_moves.csv) previously required both the source and the full destination category path to already exist; a missing destination failed the task with no auto-creation.This changes the destination handling so the final (leaf) segment of the destination path is created automatically if missing. All parent segments must still exist, and the source path is unchanged (it must fully resolve). This lets a position change create a new sub-category, and makes the operation idempotent (re-running finds the now-existing leaf instead of recreating it).
Details
resolveOrCreateDestCategory()resolves the destination path, creating only the missing leaf (returnsnullif a non-leaf parent is missing).createCategory()inserts the category withlevel = parent.level + 1and logs the creation.applyBookMove()now resolves the destination viaresolveOrCreateDestCategory()instead ofresolveCategoryPath(); the error message clarifies that only the final segment is auto-created.Single-file change to
RenameCategoriesPostProcess.kt.