Skip to content

Adding ability to specify a custom post thumbnail.#4425

Merged
Nutomic merged 7 commits intomainfrom
custom_thumbnails
Feb 15, 2024
Merged

Adding ability to specify a custom post thumbnail.#4425
Nutomic merged 7 commits intomainfrom
custom_thumbnails

Conversation

@dessalines
Copy link
Copy Markdown
Member

Comment thread crates/api_crud/src/post/create.rs Outdated
Comment thread crates/api_crud/src/post/update.rs Outdated
@dessalines dessalines marked this pull request as draft February 8, 2024 03:24
@dessalines dessalines marked this pull request as ready for review February 12, 2024 16:54
let thumbnail_url = proxy_image_link_opt_apub(custom_thumbnail, &context)
.await?
.map(Into::into)
.or(metadata.thumbnail);
Copy link
Copy Markdown
Member

@Nutomic Nutomic Feb 13, 2024

Choose a reason for hiding this comment

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

Should do the or first and then proxy afterwards, to ensure that thumbnail also gets proxied. Unless thumbnail already gets proxied previously, not sure.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, the metadata thumbnail is already proxied.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Even if a custom thumbnail is provided this will still generate a thumbnail from the url and store it in pictrs. Thats a waste of resources and should be skipped.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good call, fixed.

Comment thread crates/api_crud/src/post/update.rs
@dessalines dessalines requested a review from Nutomic February 14, 2024 16:21
@Nutomic Nutomic merged commit 3f7cc07 into main Feb 15, 2024
@Nutomic
Copy link
Copy Markdown
Member

Nutomic commented Mar 25, 2024

I just noticed that this wont work properly as the custom thumbnail is not federated. So other instances will generate a new thumbnail as usual.

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.

2 participants