From a9de7d711e1076ff9794d378db20896c7b06e2d1 Mon Sep 17 00:00:00 2001 From: Sam Pohlenz Date: Thu, 19 May 2022 09:06:58 +0930 Subject: [PATCH] Only show videos with valid thumbnails --- app/models/video.rb | 4 ++++ app/views/admin/shared/_media.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/video.rb b/app/models/video.rb index 6e1dea1..21cd760 100644 --- a/app/models/video.rb +++ b/app/models/video.rb @@ -14,4 +14,8 @@ def thumbnail "https://img.youtube.com/vi/#{key}/hqdefault.jpg" end end + + def thumbnail? + thumbnail.present? + end end diff --git a/app/views/admin/shared/_media.html.erb b/app/views/admin/shared/_media.html.erb index 99b0f3c..1387dfe 100644 --- a/app/views/admin/shared/_media.html.erb +++ b/app/views/admin/shared/_media.html.erb @@ -1,7 +1,7 @@

Videos