From 241555d9a2eaa4c29da3f2f804f42d1ad67fd374 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Thu, 15 May 2014 20:31:23 -0700 Subject: [PATCH 1/4] new version --- config/danbooru_default_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index dcd1adbe4..41d765a13 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -4,7 +4,7 @@ module Danbooru class Configuration # The version of this Danbooru. def version - "2.49.0" + "2.50.0" end # The name of this Danbooru. From 2cfc66a60a45abd5e92cb287b398febab29f20ed Mon Sep 17 00:00:00 2001 From: r888888888 Date: Thu, 15 May 2014 21:46:01 -0700 Subject: [PATCH 2/4] remove intelligent autocomplete expiry --- app/assets/javascripts/autocomplete.js | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/app/assets/javascripts/autocomplete.js b/app/assets/javascripts/autocomplete.js index 1988c53af..fa5b57133 100644 --- a/app/assets/javascripts/autocomplete.js +++ b/app/assets/javascripts/autocomplete.js @@ -21,17 +21,6 @@ Danbooru.Autocomplete.prune_local_storage = function() { if (this.enable_local_storage) { - var now = new Date().getTime(); - $.each($.localStorage.keys(), function(i, key) { - var obj = localStorage.getItem(key); - if (obj && obj.expires) { - var expiry = Date.parse(obj.expires); - if (expiry < now) { - $.localStorage.remove(key); - } - } - }); - if ($.localStorage.keys().length > 4000) { $.localStorage.removeAll(); } @@ -178,12 +167,8 @@ if (this.enable_local_storage) { var cached = $.localStorage.get(key); if (cached) { - if (cached.expires < new Date()) { - $.localStorage.remove(key); - } else { - resp(cached.value); - return; - } + resp(cached.value); + return; } } From 8f18b346ef0896938e7dd46da996269ea22685e8 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Thu, 15 May 2014 22:12:01 -0700 Subject: [PATCH 3/4] new version --- config/danbooru_default_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index 41d765a13..e3cfd8c67 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -4,7 +4,7 @@ module Danbooru class Configuration # The version of this Danbooru. def version - "2.50.0" + "2.50.1" end # The name of this Danbooru. From bfd1924481ee1e4bbc0cc06c4c80012fc3970d23 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Thu, 15 May 2014 22:14:08 -0700 Subject: [PATCH 4/4] fixes #2155 --- app/controllers/iqdb_queries_controller.rb | 1 + app/views/iqdb_queries/create_by_url.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/iqdb_queries_controller.rb b/app/controllers/iqdb_queries_controller.rb index de0628976..4fa85fcfe 100644 --- a/app/controllers/iqdb_queries_controller.rb +++ b/app/controllers/iqdb_queries_controller.rb @@ -19,6 +19,7 @@ protected @download = Iqdb::Download.new(params[:url]) @download.download_from_source @download.find_similar + @results = @download.matches render :layout => false, :action => "create_by_url" end diff --git a/app/views/iqdb_queries/create_by_url.html.erb b/app/views/iqdb_queries/create_by_url.html.erb index 5c3d96a41..f66fb5b58 100644 --- a/app/views/iqdb_queries/create_by_url.html.erb +++ b/app/views/iqdb_queries/create_by_url.html.erb @@ -1,6 +1,6 @@ -<% if @download.any? %> +<% if @results.any? %>

Similar

- <% @download.each do |match| %> + <% @results.each do |match| %> <%= PostPresenter.preview(Post.find(match.post_id)) %> <% end %> <% else %>