Files
velour/app/models/video.rb
Dan Milne 88a906064f
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled
Much base work started
2025-10-31 14:36:14 +11:00

21 lines
527 B
Ruby

class Video < MediaFile
# Video-specific associations
has_many :video_assets, dependent: :destroy
# Video-specific metadata store
store :video_metadata, accessors: [:width, :height, :video_codec, :audio_codec, :frame_rate]
# Video-specific instance methods
def resolution_label
return "Unknown" unless height
case height
when 0..480 then "SD"
when 481..720 then "720p"
when 721..1080 then "1080p"
when 1081..1440 then "1440p"
when 1441..2160 then "4K"
else "8K+"
end
end
end