diff options
| author | Ken D'Ambrosio <ken@jots.org> | 2026-05-14 22:59:59 +0000 |
|---|---|---|
| committer | Ken D'Ambrosio <ken@jots.org> | 2026-05-14 22:59:59 +0000 |
| commit | c76ea393777897e0c367e186d1a3b243193d8377 (patch) | |
| tree | b922795d65bcbea171ef6c2ddf6b3c80881123d2 /app.rb | |
| parent | 6acd47c1ca27d705afe88b292a55a5170c038d2e (diff) | |
Hide transcoded originals from non-admins; mark them visually for admins
update.rb records transcoded_to in album.json (even on re-runs where
the MP4 already exists) so the marker survives across scans.
app.rb filters files with transcoded_to from non-admin views.
album.erb renders them greyed-out with an amber "⚠ original" badge in
admin mode. admin/album.erb marks the edit-table row and shows the
target filename under the original.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app.rb')
| -rw-r--r-- | app.rb | 28 |
1 files changed, 15 insertions, 13 deletions
@@ -90,20 +90,22 @@ helpers do entries = files.filter_map do |name| meta = (data['files'] || {})[name] || {} next if meta['visible'] == false && !admin? + next if meta['transcoded_to'] && !admin? { - name: name, - title: meta['title'] || name, - caption: meta['caption'], - visible: meta.fetch('visible', true), - type: media_type_for(name), - taken_at: meta['taken_at'], - width: meta['width'], - height: meta['height'], - duration: meta['duration'], - camera: meta['camera'], - aperture: meta['aperture'], - shutter: meta['shutter'], - iso: meta['iso'], + name: name, + title: meta['title'] || name, + caption: meta['caption'], + visible: meta.fetch('visible', true), + type: media_type_for(name), + taken_at: meta['taken_at'], + width: meta['width'], + height: meta['height'], + duration: meta['duration'], + camera: meta['camera'], + aperture: meta['aperture'], + shutter: meta['shutter'], + iso: meta['iso'], + transcoded_to: meta['transcoded_to'], } end |
