Merge pull request #3120 from evazion/fix-gallery-warning

Fix gallery warning for non-Pixiv galleries.
This commit is contained in:
Albert Yi
2017-06-08 14:05:13 -07:00
committed by GitHub
4 changed files with 6 additions and 7 deletions

View File

@@ -102,7 +102,7 @@
$("#source-record").html($("<a>").attr("href", new_artist_href).text("Create New"));
if (data.page_count > 1) {
if (data.image_urls.length > 1) {
$("#gallery-warning").show();
} else {
$("#gallery-warning").hide();

View File

@@ -5,7 +5,7 @@ module Sources
attr_reader :url, :strategy
delegate :get, :get_size, :site_name, :artist_name,
:profile_url, :image_url, :tags, :artist_record, :unique_id,
:page_count, :file_url, :ugoira_frame_data, :ugoira_content_type, :image_urls,
:file_url, :ugoira_frame_data, :ugoira_content_type, :image_urls,
:artist_commentary_title, :artist_commentary_desc,
:dtext_artist_commentary_title, :dtext_artist_commentary_desc,
:rewrite_thumbnails, :illust_id_from_url, :to => :strategy
@@ -63,13 +63,13 @@ module Sources
:artist_name => artist_name,
:profile_url => profile_url,
:image_url => image_url,
:image_urls => image_urls,
:normalized_for_artist_finder_url => normalize_for_artist_finder!,
:tags => tags,
:translated_tags => translated_tags,
:danbooru_name => artist_record.try(:first).try(:name),
:danbooru_id => artist_record.try(:first).try(:id),
:unique_id => unique_id,
:page_count => page_count,
:artist_commentary => {
:title => artist_commentary_title,
:description => artist_commentary_desc,

View File

@@ -10,7 +10,7 @@ module Sources
module Strategies
class Base
attr_reader :url, :referer_url
attr_reader :artist_name, :profile_url, :image_url, :tags, :page_count
attr_reader :artist_name, :profile_url, :image_url, :tags
attr_reader :artist_commentary_title, :artist_commentary_desc
def self.url_match?(url)
@@ -20,7 +20,6 @@ module Sources
def initialize(url, referer_url = nil)
@url = url
@referer_url = referer_url
@page_count = 1
end
# No remote calls are made until this method is called.

View File

@@ -77,7 +77,7 @@ module Sources
end
should "get the page count" do
assert_equal(3, @site.page_count)
assert_equal(3, @site.image_urls.size)
end
should "get the tags" do
@@ -108,7 +108,7 @@ module Sources
end
should "get the page count" do
assert_equal(1, @site.page_count)
assert_equal(1, @site.image_urls.size)
end
should "get the full size image url" do