posts: fix placeholder thumbnail for Flash files.

* Replace the "Download" placeholder thumbnail for Flash files with a
  new placeholder that specifically says it's a Flash file.
* Fix a bug where the Flash placeholder thumbnail was too small when
  using larger thumbnail sizes.
* Fix it so that media assets don't falsely consider Flash files to have
  thumbnails. This could potentially cause errors if someone tried to
  expunge, replace, or regenerate a Flash post.
This commit is contained in:
evazion
2022-10-16 16:42:15 -05:00
parent d4492e3c22
commit 3b0e94040f
6 changed files with 44 additions and 45 deletions

View File

@@ -162,6 +162,8 @@ class Post < ApplicationRecord
end
def preview_file_url
# XXX hack to return placeholder thumbnail for Flash files the /posts.json API.
return Danbooru.config.storage_manager.file_url("/images/flash-preview.png") if media_asset.is_flash?
media_asset.variant(:preview).file_url
end