rely on preview urls if available for gallery

This commit is contained in:
Albert Yi
2018-09-11 14:57:18 -07:00
parent e0e85a3139
commit 4972c998f8
8 changed files with 42 additions and 2 deletions

View File

@@ -36,6 +36,12 @@ module Sources::Strategies
end
memoize :image_urls
def preview_urls
image_urls.map do |x|
x.sub(%r!\.(jpg|jpeg|png|gif)(?::orig)?\z!i, '.\1:small')
end
end
def page_url
[url, referer_url].each do |x|
if self.class.status_id_from_url(x).present?