Repository navigation
Conversation
Kavita's library scan-folder endpoint expects an absolute directory path within a configured library. Previously, Chaptarr was sending $"{header} - {message}" (e.g. "Chaptarr - Book Downloaded - /media/Books/Author/Title"), causing Kavita's DirectoryService to fail with a 500 ArgumentOutOfRangeException when resolving parent directories back to root.
This change passes the directory path directly without the branded title prefix, guards against empty book file lists, and corrects the log message.
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.
Description
When notifying Kavita of an imported book, deleted file, or retagged release, Chaptarr was sending
$"{header} - {message}"(e.g.,"Chaptarr - Book Downloaded - /media/Books/Author/Title") asfolderPathto Kavita'sPOST /api/library/scan-folderendpoint.Because Kavita's directory traversal logic (
DirectoryService.GetFoldersTillRoot) expects an actual filesystem path within the library root, the branded title prefix caused directory peeling to exhaust all slashes, throwing an unhandledArgumentOutOfRangeException: length ('-1') must be a non-negative value(HTTP 500).This change:
_kavitaService.Notifywithout the branded title prefix.nullor whitespace paths before dispatching..First()with.FirstOrDefault()when resolving paths fromBookFilesto avoidInvalidOperationExceptionon empty collections.messagetofolderPathinIKavitaServiceandIKavitaServiceProxy.Kavita.csthat referenced "Subsonic".KavitaFixture.Fixes #
Database Migration
NO
How was this tested?
jvmilazz0/kavita:latest).OnReleaseImport)."Chaptarr - Book Downloaded - /media/Books/...".POST /api/library/scan-folderwith clean folder paths ({"apiKey": "...", "folderPath": "/media/Books/Author/Title"}), which responds HTTP 200 and initiates the