Skip to content
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

Kemono Party - Support /posts endpoint and Creator Tag Calls #6833

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

BishopRed90
Copy link
Contributor

Hello,

I've added support for getting a creator that is filtered by a tag. The endpoint seems to be a legacy one as there is not an alternative.

I've also added some changes to support the /posts endpoint to work. It was failing if the config['metadata'] had been set due to it reaching out for a blank user/service id.

Fixed the pagination prematurely exiting also for those endpoints as they require a key for their results and the check was for the raw object.

@mikf
Copy link
Owner

mikf commented Jan 15, 2025

No type hints, no f-strings, no re-indenting existing/unrelated code for no reason.

@BishopRed90
Copy link
Contributor Author

  1. Removed Type Hints
  2. Replaced F-strings with "".format
  3. Restored indenting/formatting for unrelated code changes.

@mikf mikf force-pushed the KemonoParty_UserTags branch 2 times, most recently from 91aedf4 to dc4d577 Compare January 21, 2025 18:18
- Adding support for calling a creator with a tag selected.
    It is using a legacy endpoint but there is no other way currently
    documented to get the users post filtered by a tag.
- Fixing the User Tags feature to be paginated
    offset is not defined in the API but it is supported.
- Fixed the `/posts` endpoint not working:
    1. Added check along with metadata to make sure there is a
       creator/service information as that is a requirement
    2. Fixed the parameter from tags -> tag.
    3. Fixed the _paginate call to exit correctly when there is
       a key required for the data (it was prematurely exiting)
- Adding a type of caching mechanism for the metadata/user information.
    The current logic would work just fine if looking up for a
    singular user, however for the multiple posts via normal
    filtering would cause it to either:
    This builds a local cache during the process so it should
    only make a call for the user info once during the process.
- Updating to meet standards
    Fixes
      1. Reset formatting for unnecessary line changes
      2. Removed Type Hinting
      3.Replaced f-string with "".format
   Updates
     Renamed function creator_posts_tags -> creator_tagged_posts
     for clarity of what it does (get posts tags vs get tagged posts)
- Fixing check for the length of response:
    1. If it is list - just check len
    2. If there is a key - check that the key length is less
       than the batch.
- add test for '?tag=...' user URLs
    plus some code simplifications
@mikf mikf force-pushed the KemonoParty_UserTags branch from dc4d577 to b11434a Compare January 21, 2025 18:20
@mikf mikf merged commit 4d609e2 into mikf:master Jan 21, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants