merge master into autocomplete-aliased-tags

This commit is contained in:
Toks
2015-04-07 15:00:39 -04:00
15 changed files with 33 additions and 87 deletions

View File

@@ -48,12 +48,18 @@ private
case token[0]
when :create_alias
tag_alias = TagAlias.create(:forum_topic_id => forum_id, :status => "pending", :antecedent_name => token[1], :consequent_name => token[2])
unless tag_alias.valid?
raise "Error: #{tag_alias.errors.full_messages.join("; ")} (create alias #{tag_alias.antecedent_name} -> #{tag_alias.consequent_name})"
end
tag_alias.rename_wiki_and_artist if rename_aliased_pages?
tag_alias.delay(:queue => "default").process!
tag_alias.delay(:queue => "default").process!(false)
when :create_implication
tag_implication = TagImplication.create(:forum_topic_id => forum_id, :status => "pending", :antecedent_name => token[1], :consequent_name => token[2])
tag_implication.delay(:queue => "default").process!
unless tag_implication.valid?
raise "Error: #{tag_implication.errors.full_messages.join("; ")} (create implication #{tag_implication.antecedent_name} -> #{tag_implication.consequent_name})"
end
tag_implication.delay(:queue => "default").process!(false)
when :remove_alias
tag_alias = TagAlias.where("antecedent_name = ?", token[1]).first

View File

@@ -47,12 +47,18 @@ module Sources
end
def get_image_url_from_page(page)
download_link = page.link_with(:class => /dev-page-download/)
image = page.search("div.dev-view-deviation img.dev-content-full")
if download_link
download_link.click.uri.to_s # need to follow the redirect now to get the full size url, following it later seems to not work.
if image.any?
image[0]["src"]
else
nil
download_link = page.link_with(:class => /dev-page-download/)
if download_link
download_link.click.uri.to_s # need to follow the redirect now to get the full size url, following it later seems to not work.
else
nil
end
end
end