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

Fix is_image attachment attribute to properly reflect whether the attachment is an image #17

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

khakers
Copy link
Collaborator

@khakers khakers commented Aug 3, 2023

This PR adds the content_type field to message attachments stored within MongoDB modmail logs and refactors the is_image field to be based off content type instead of width. The previous behavior lead to problems with content such as video which also have a width. content_type is a direct copy of the information as reported by discord. This will also fix an issue (for newly sent attachments only) in logviewer where videos are broken because it tries to load them as images.

I'm not totally sure why the code was done like this in the first place, because discord.py clearly states that it applies to videos, so maybe there's some actual reason behind this that I'm just unaware of?

@netlify
Copy link

netlify bot commented Aug 3, 2023

Deploy Preview for modmail-docs canceled.

Name Link
🔨 Latest commit 47913f5
🔍 Latest deploy log https://app.netlify.com/sites/modmail-docs/deploys/64caf5407471cc0008597f4e

@khakers khakers merged commit c6d3339 into raidensakura:develop Aug 9, 2023
5 checks passed
@khakers khakers deleted the media-content-fix branch August 9, 2023 18:26
This pull request was closed.
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