feat(flags): add new flags to Embed and update Attachment flags - #1283
feat(flags): add new flags to Embed and update Attachment flags#1283Snipy7374 wants to merge 19 commits into
Conversation
| if self._thumbnail and (thumbnail_flags := self._thumbnail.get("flags")): | ||
| self._thumbnail["flags"] = EmbedMediaFlags._from_value(thumbnail_flags) # type: ignore | ||
|
|
||
| self._video = data.get("video") | ||
| self._provider = data.get("provider") | ||
| self._author = data.get("author") | ||
|
|
||
| self._image = data.get("image") | ||
| if self._image and (image_flags := self._image.get("flags")): | ||
| self._image["flags"] = EmbedMediaFlags._from_value(image_flags) # type: ignore | ||
|
|
There was a problem hiding this comment.
I don't like how this is done but I don't see much alternatives
There was a problem hiding this comment.
Rather than save it here, we could make the flags when we access the image or thumbnail, no?
There was a problem hiding this comment.
This also no longer seems to be respected in serialisation.
There was a problem hiding this comment.
This also no longer seems to be respected in serialisation.
What do you mean? It's not consistent with the lib?
There was a problem hiding this comment.
Rather than save it here, we could make the flags when we access the image or thumbnail, no?
that was my idea as well. It's still a bit awkward, but a separate EmbedProxy subclass that special-cases flags should do, and doesn't result in weird consistency issues with from_dict and to_dict.
Co-authored-by: Eneg <42005170+Enegg@users.noreply.github.com> Signed-off-by: arielle <me@arielle.codes>
|
@Snipy7374 would you please resolve conflicts and rebase? |
|
@Snipy7374 any update on this? Would be great to have these flags available, especially for implementing attachment editing later on. |
Yes sir 🫡 , will try to complete my open PRs this week |
Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com> Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com>
Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com> Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com>
Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com> Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com>
Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com> Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com>
Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com> Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com>
Summary
Checklist
pdm lintpdm pyright