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

Adding ability to specify a custom post thumbnail. #4425

Merged
merged 7 commits into from
Feb 15, 2024
Merged

Conversation

dessalines
Copy link
Member

@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
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
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
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
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.

@Nutomic Nutomic merged commit 3f7cc07 into main Feb 15, 2024
2 checks passed
@Nutomic
Copy link
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.

None yet

2 participants