Skip to content

[kemono] fix missing latest revision for revisions endpoint#9112

Open
AngeredBacterium wants to merge 1 commit intomikf:masterfrom
AngeredBacterium:kemono-missing-latest-rev
Open

[kemono] fix missing latest revision for revisions endpoint#9112
AngeredBacterium wants to merge 1 commit intomikf:masterfrom
AngeredBacterium:kemono-missing-latest-rev

Conversation

@AngeredBacterium
Copy link
Copy Markdown
Contributor

Currently, given a post with multiple revisions like this one taken from the kemono tests:

  • Fetching the post with revisions=true will fetch all 12 with revision_count: 12 metadata
  • Fetching a specific revision will fetch that revision with revision_count: 11 metadata
  • Fetching the post with /revisions added to the URL will fetch the 11 old revisions (excluding the current/latest version) with revision_count: 11 metadata

If 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 /revisions API 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:

  1. Remove support for URLs ending with /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 with revisions=true.
  2. Set revision_index and revision_count based on the indices & count before the deduping with revisions=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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant