uploads: allow admins to upload videos more than 2 minutes long.

At some point the ability for admins to bypass the video length
restriction got lost.

ref: https://danbooru.donmai.us/forum_topics/14647
This commit is contained in:
evazion
2020-06-09 03:06:07 -05:00
parent d002701bc1
commit 8b5ffb4c43
2 changed files with 15 additions and 1 deletions

View File

@@ -53,7 +53,7 @@ class Upload < ApplicationRecord
end
def validate_video_duration(record)
if record.media_file.is_video? && record.media_file.duration > 120
if !record.uploader.is_admin? && record.media_file.is_video? && record.media_file.duration > 120
record.errors[:base] << "video must not be longer than 2 minutes"
end
end