uploads: show similar images for disk uploads.

Fix the upload page so that it shows similar images (IQDB matches) for
files uploaded from your computer. Before this only worked for files
uploaded from a source.
This commit is contained in:
evazion
2022-01-28 21:07:06 -06:00
parent c0730630af
commit 21dcf53dcb
7 changed files with 32 additions and 29 deletions

View File

@@ -1,6 +1,8 @@
# frozen_string_literal: true
class Upload < ApplicationRecord
extend Memoist
MAX_VIDEO_DURATION = 140
attr_accessor :file
@@ -76,7 +78,14 @@ class Upload < ApplicationRecord
raise
end
def source_strategy
return nil if source.blank?
Sources::Strategies.find(source, referer_url)
end
def self.available_includes
[:uploader, :upload_media_assets, :media_assets]
end
memoize :source_strategy
end