summaryrefslogtreecommitdiffstats
path: root/app.rb
diff options
context:
space:
mode:
authorKen D'Ambrosio <ken@jots.org>2026-06-18 21:57:44 +0000
committerKen D'Ambrosio <ken@jots.org>2026-06-18 21:57:44 +0000
commit462e0081cc9062beb29530e84d15edf2003802db (patch)
tree04fb50e8471e1905d661d40fc8a2df6705b4ddb3 /app.rb
parent547b51c0ec6be8786eea625423d24f0ae1a884c0 (diff)
Fix transcoded video playback in lightbox and slideshow
The HEVC-to-H.264 transcode kept the original file as a hidden (non-admin) entry with transcoded_to set, but the lightbox <video> element and the slideshow always pointed at the original file's URL. Opening a transcoded video (e.g. via a direct ?photo= link) tried to play the unsupported original codec instead of the browser-compatible copy. - album.erb/album.js: lightbox video now plays the transcoded file when present, while the "Download Original" link still serves the true original. - all_media_entries: slideshow skips transcoded originals entirely since it has no separate download path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app.rb')
-rw-r--r--app.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app.rb b/app.rb
index ff1e1fa..7d6489a 100644
--- a/app.rb
+++ b/app.rb
@@ -531,7 +531,7 @@ def all_media_entries(top_dirs: nil)
rel = dir.delete_prefix(MEDIA_ROOT).delete_prefix('/')
data = load_album(dir)
next [] if data['visible'] == false && !admin?
- album_files(dir, data).select { |e| %i[image video].include?(e[:type]) }.map do |e|
+ album_files(dir, data).select { |e| %i[image video].include?(e[:type]) && !e[:transcoded_to] }.map do |e|
e.merge(file_rel: rel.empty? ? e[:name] : "#{rel}/#{e[:name]}")
end
end