-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle updates through merged chapters #5
base: master
Are you sure you want to change the base?
Conversation
For example: ch2 1.zip ch2 2.zip Kavita will merge these into one big ch2. Recognize and handle chapter merges.
override fun pageListRequest(chapter: SChapter): Request { | ||
return GET("$apiUrl/${chapter.url}", headersBuilder().build()) | ||
// remove potential _<part> chapter salt | ||
val chapterId = chapter.url.substringBefore("_") | ||
return GET("$apiUrl/$chapterId", headersBuilder().build()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@majora2007 we sure there won't ever be other underscores apart from the salt one we add, right? Otherwise seems fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the url map to? A special can technically have _ in the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url is defined as url = chapter.id.toString().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So maybe I missed it, how is the underscore being sent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s not, I’m adding it locally.
<chapterId>_<numberOfFiles>
As ThePromidius points out, this approach would fail if the id somehow already contains an underscore.
When a chapter gets new content server side through chapter merges, not only does the extension not notify the user of this update, but as long as the old data still resides in the cache, it’s straight up impossible to access the new chapter part.
This fix assumes the only way a chapter would have multiple files is through part merges.
Unless multiple files are reported, nothing is changed, so this should be fairly backwards compatible too.
See also:
Kareadita/Kavita#3272
Checklist:
extVersionCode
value inbuild.gradle
for individual extensionsoverrideVersionCode
orbaseVersionCode
as needed for all multisrc extensionsisNsfw = true
flag inbuild.gradle
when appropriateid
if a source's name or language were changed