uploads: factor out remaining image methods to MediaFile.

This commit is contained in:
evazion
2020-05-19 02:18:30 -05:00
parent 45064853de
commit 364343453c
7 changed files with 56 additions and 88 deletions

View File

@@ -1,10 +1,12 @@
class MediaFile::Video < MediaFile
extend Memoist
def dimensions
[video.width, video.height]
end
def duration
video.duration
end
def preview(max_width, max_height)
preview_frame.preview(max_width, max_height)
end
@@ -13,6 +15,10 @@ class MediaFile::Video < MediaFile
preview_frame.crop(max_width, max_height)
end
def has_audio?
video.audio_channels.present?
end
private
def video