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

[mastodon] Use boolean instead of integer keys for accounts/statuses endpoint #5516

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

cenodis
Copy link
Contributor

@cenodis cenodis commented Apr 26, 2024

According to the mastodon API documentation the only_media and exclude_replies parameters must be boolean:

only_media
Boolean. Filter out statuses without attachments.
exclude_replies
Boolean. Filter out statuses in reply to a different account.

https://docs.joinmastodon.org/methods/accounts/#query-parameters

The current implementation passes them as integers which causes issues with other services that implement the mastodon API, in my case Mitra instances.

@mikf
Copy link
Owner

mikf commented Apr 26, 2024

According to the mastodon API documentation, 0 and 1 should be the same as false and true:

A boolean value is considered false for the values 0, f, F, false, FALSE, off, OFF; … and considered to be true for all other values

https://docs.joinmastodon.org/client/intro/#boolean

@cenodis
Copy link
Contributor Author

cenodis commented Apr 26, 2024

Good point. The primary fault would be on Mitras side then. Might still be a good idea to pass the "canonical" parameters to minimize incompatabilities.

Currently gallery-dl does not work with Mitra servers due to this. Compare:
https://mitra.social/api/v1/accounts/dd4ebc18-269d-4c7b-a310-03d29c6ab551/statuses?only_media=0&exclude_replies=0
vs.
https://mitra.social/api/v1/accounts/dd4ebc18-269d-4c7b-a310-03d29c6ab551/statuses?only_media=false&exclude_replies=false

@cenodis
Copy link
Contributor Author

cenodis commented Apr 26, 2024

For future reference, I have opened an issue with Mitra about this:

https://codeberg.org/silverpill/mitra/issues/63

@mikf mikf merged commit 7fd31aa into mikf:master Apr 27, 2024
9 checks passed
@cenodis cenodis deleted the patch-1 branch April 27, 2024 16:59
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