Fix regression due to 914ada1c74
.
This commit is contained in:
parent
f5ac01253a
commit
f0bb492d24
|
@ -17,8 +17,10 @@ module HasUrl
|
||||||
return if uri&.path.blank?
|
return if uri&.path.blank?
|
||||||
data = extract_url(uri.path)
|
data = extract_url(uri.path)
|
||||||
return if data.blank?
|
return if data.blank?
|
||||||
|
sha1 = data[2]
|
||||||
self.find_by("url LIKE ?", "%#{data[1]}")
|
result = nil
|
||||||
|
result = self.find_by(sha1: sha1) if sha1&.length == Upload::SHA1_LENGTH
|
||||||
|
result || self.find_by("url LIKE ?", "%#{data[1]}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue