Mastodon.py icon indicating copy to clipboard operation
Mastodon.py copied to clipboard

Not consistent use of `expires_in` vs `expires_at` with filters

Open e11bits opened this issue 3 years ago • 1 comments

The filter_dict, that the reading methods Mastodon.filters or Mastodon.filter return, uses the key expires_at.

But the writing methods Mastodon.filter_create or Mastodon.filter_update use expires_in as a keyword.

If the filter_dict would match the keyword parameters of the methods, it would be easier to use the unpacking operator (**) like (with id removed from the filter_dict)

Mastodon.filter_update(**filter_dict)

e11bits avatar Dec 04 '22 08:12 e11bits

That sounds like a good idea, though probably, we should support both (the mastodon API takes them as expires_in). Not really a problem, though, can just convert the time as appropriate.

However, as far as I know, the filter API as it currently is implemented works only on pre-4.0. So probably it is better to change this after making all 4.0 related updates. I'm currently taking a short break from maintenance to do some other things, dogfooding mastodon.py being one of those things, but I'll get back to it soon enough.

halcy avatar Dec 04 '22 16:12 halcy