Merge pull request #4947 from nonamethanks/fix-duration-twitter

Fix duration check for uploads from twitter
This commit is contained in:
evazion
2021-12-29 22:33:59 -06:00
committed by GitHub

View File

@@ -57,7 +57,7 @@ class Upload < ApplicationRecord
end
def validate_video_duration(record)
if !record.uploader.is_admin? && record.file.is_video? && record.file.duration > MAX_VIDEO_DURATION
if !record.uploader.is_admin? && record.file.is_video? && record.file.duration.to_i > MAX_VIDEO_DURATION
record.errors.add(:base, "video must not be longer than #{MAX_VIDEO_DURATION.seconds.inspect}")
end
end