diff --git a/app/assets/stylesheets/mobile.css.scss b/app/assets/stylesheets/mobile.css.scss deleted file mode 100644 index 4a785ec8f..000000000 --- a/app/assets/stylesheets/mobile.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -/* - *= require_tree "./mobile" -*/ diff --git a/app/logical/post_sets/artist.rb b/app/logical/post_sets/artist.rb index d7dbb4903..4cbec68aa 100644 --- a/app/logical/post_sets/artist.rb +++ b/app/logical/post_sets/artist.rb @@ -9,6 +9,8 @@ module PostSets def posts ::Post.tag_match(@artist.name) + rescue ::Post::SearchError + ::Post.where("false") end def presenter diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 0f7e2c972..4534fc9dc 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -29,6 +29,8 @@ module PostSets end @posts ||= ::Post.tag_match(tag_string).paginate(page) + rescue ::Post::SearchError + @posts = ::Post.where("false") end def has_artist? diff --git a/app/logical/sources/strategies/pixiv.rb b/app/logical/sources/strategies/pixiv.rb index def6920a5..c9cd33c41 100644 --- a/app/logical/sources/strategies/pixiv.rb +++ b/app/logical/sources/strategies/pixiv.rb @@ -42,7 +42,7 @@ module Sources def get_image_url_from_page(page) meta = page.search("meta[property=\"og:image\"]").first if meta - meta.attr("content").sub(/_m\./, ".") + meta.attr("content").sub(/_[ms]\./, ".") else nil end diff --git a/app/models/artist.rb b/app/models/artist.rb index 0b1a302c2..7f99e256e 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -171,13 +171,17 @@ class Artist < ActiveRecord::Base def ban! Post.transaction do - Post.tag_match(name).each do |post| - begin - post.flag!("Artist requested removal") - rescue PostFlag::Error - # swallow + begin + Post.tag_match(name).each do |post| + begin + post.flag!("Artist requested removal") + rescue PostFlag::Error + # swallow + end + post.delete! end - post.delete! + rescue Post::SearchError + # swallow end # potential race condition but unlikely diff --git a/app/models/post.rb b/app/models/post.rb index f41e64c4b..3518db7eb 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -659,6 +659,8 @@ class Post < ActiveRecord::Base end end count + rescue SearchError + 0 end end diff --git a/app/views/layouts/mobile.html.erb b/app/views/layouts/mobile.html.erb deleted file mode 100644 index 33b14335a..000000000 --- a/app/views/layouts/mobile.html.erb +++ /dev/null @@ -1,41 +0,0 @@ - - -
-