Skip to content

Conversation

@m-star18
Copy link
Member

Overview

お気持ち: top imageの値をimage_messageと同じ感じにしたい
動作確認済み

Issue number

Close #57

How to check the revision

Points for Review

Remarks

急いで書いたから, 細かいところまで配慮できてないかも...
余裕があったらみてほしい

@m-star18 m-star18 added the type:feature Feature Request label Dec 17, 2022
@m-star18 m-star18 self-assigned this Dec 17, 2022
Copy link
Member

@kathmandu777 kathmandu777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よろしくおねがいします。

Comment on lines +35 to +39
cls,
request: Request,
id: str,
text_messages_limit: int,
image_messages_limit: int,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatterの修正が環境によってずれることあるかな?

Comment on lines +88 to +95
image = Image.open(io.BytesIO(image_binary)).convert("RGB")
image_io = io.BytesIO()
image_name = "top_image.jpeg"
image.save(image_io, format="JPEG")
image_file = InMemoryUploadedFile(image_io, field_name=None, name=image_name,
content_type="image/jpeg", size=image_io.getbuffer().nbytes,
charset=None)
project.top_image = image_file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

未検証
かなり回りくどい実装っぽいけどとりあえずいいや

# TODO: 簡略化

みたいなこめんとあるといいかも

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK!

return random.choice(spotify_uri_candidates)


def upload_to_top_image(instance: "Project", filename: str) -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instance -> project
でいいと思うけどどうでしょうか?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

んーーどういうことかいまいちわかってないかも..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature Feature Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

top_imageのapiを修正する

3 participants