[kemono] fix missing latest revision for revisions endpoint#9112
Open
AngeredBacterium wants to merge 1 commit intomikf:masterfrom
Open
[kemono] fix missing latest revision for revisions endpoint#9112AngeredBacterium wants to merge 1 commit intomikf:masterfrom
AngeredBacterium wants to merge 1 commit intomikf:masterfrom
Conversation
87c7261 to
b5b6090
Compare
b5b6090 to
d6c8f10
Compare
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.
Currently, given a post with multiple revisions like this one taken from the kemono tests:
revisions=truewill fetch all 12 withrevision_count: 12metadatarevision_count: 11metadata/revisionsadded to the URL will fetch the 11 old revisions (excluding the current/latest version) withrevision_count: 11metadataIf this is intentional you can close this PR, but I doubt it is as it seems like a very weird use-case and inconsistency.
As far as I can tell this was because the
/revisionsAPI endpoint only returns the older revisions, which is what was always used to fetch revisions before 7784aed.Here I've just prefixed the revisions list with the current post, like another code path does.
If you're okay with this change, I'd like to make some related changes in other PRs:
/revisions, e.g. the URL from the tests:https://kemono.cr/patreon/user/3161935/post/68231671/revisions. This kind of URL will always 404 since kemono/coomer don't support it, so the only way it can be used is if you already know gallery-dl handles it, and after this PR it'd just work as if you fetched the post normally withrevisions=true.revision_indexandrevision_countbased on the indices & count before the deduping withrevisions=unique(I mentioned this in my other wall of text [kemono] Inconsistent revision data & suggestions #8894). I guess this is subjective but I think it'd be preferable to keep the source info.