Much base work started
This commit is contained in:
20
app/models/video.rb
Normal file
20
app/models/video.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
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
|
||||
Reference in New Issue
Block a user