Mastodon: Fixed media uploads. Closes #513

This commit is contained in:
Manuel Cortez 2023-02-06 05:02:40 -06:00
parent ad8667a13c
commit d0e18178c6
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790
2 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ This release focuses on fixing some important bugs that have been reported in th
* Added notification when a user joins an instance. This notification is only available for administrators. * Added notification when a user joins an instance. This notification is only available for administrators.
* Added option to disable Streaming in the account options. This can be useful if TWBlue, for some reason, repeatedly calls the instance API. * Added option to disable Streaming in the account options. This can be useful if TWBlue, for some reason, repeatedly calls the instance API.
* Improved the code that works with the Streaming API to reduce the number of reconnection attempts TWBlue performs. * Improved the code that works with the Streaming API to reduce the number of reconnection attempts TWBlue performs.
* Fixed media uploads for audio, video and gifvs. ([#513](https://github.com/MCV-Software/TWBlue/issues/513))
## Changes in version 2023.2.3 ## Changes in version 2023.2.3

View File

@ -210,7 +210,7 @@ class Session(base.baseSession):
poll = self.api.make_poll(options=obj["attachments"][0]["options"], expires_in=obj["attachments"][0]["expires_in"], multiple=obj["attachments"][0]["multiple"], hide_totals=obj["attachments"][0]["hide_totals"]) poll = self.api.make_poll(options=obj["attachments"][0]["options"], expires_in=obj["attachments"][0]["expires_in"], multiple=obj["attachments"][0]["multiple"], hide_totals=obj["attachments"][0]["hide_totals"])
else: else:
for i in obj["attachments"]: for i in obj["attachments"]:
img = self.api_call("media_post", media_file=i["file"], description=i["description"]) img = self.api_call("media_post", media_file=i["file"], description=i["description"], synchronous=True)
media_ids.append(img.id) media_ids.append(img.id)
item = self.api_call(call_name="status_post", status=text, _sound="tweet_send.ogg", in_reply_to_id=in_reply_to_id, media_ids=media_ids, visibility=visibility, poll=poll, sensitive=obj["sensitive"], spoiler_text=obj["spoiler_text"]) item = self.api_call(call_name="status_post", status=text, _sound="tweet_send.ogg", in_reply_to_id=in_reply_to_id, media_ids=media_ids, visibility=visibility, poll=poll, sensitive=obj["sensitive"], spoiler_text=obj["spoiler_text"])
if item != None: if item != None: