This commit is contained in:
Toks
2014-05-16 20:49:19 -04:00
4 changed files with 6 additions and 20 deletions

View File

@@ -21,17 +21,6 @@
Danbooru.Autocomplete.prune_local_storage = function() { Danbooru.Autocomplete.prune_local_storage = function() {
if (this.enable_local_storage) { 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) { if ($.localStorage.keys().length > 4000) {
$.localStorage.removeAll(); $.localStorage.removeAll();
} }
@@ -178,12 +167,8 @@
if (this.enable_local_storage) { if (this.enable_local_storage) {
var cached = $.localStorage.get(key); var cached = $.localStorage.get(key);
if (cached) { if (cached) {
if (cached.expires < new Date()) { resp(cached.value);
$.localStorage.remove(key); return;
} else {
resp(cached.value);
return;
}
} }
} }

View File

@@ -19,6 +19,7 @@ protected
@download = Iqdb::Download.new(params[:url]) @download = Iqdb::Download.new(params[:url])
@download.download_from_source @download.download_from_source
@download.find_similar @download.find_similar
@results = @download.matches
render :layout => false, :action => "create_by_url" render :layout => false, :action => "create_by_url"
end end

View File

@@ -1,6 +1,6 @@
<% if @download.any? %> <% if @results.any? %>
<h3>Similar</h3> <h3>Similar</h3>
<% @download.each do |match| %> <% @results.each do |match| %>
<%= PostPresenter.preview(Post.find(match.post_id)) %> <%= PostPresenter.preview(Post.find(match.post_id)) %>
<% end %> <% end %>
<% else %> <% else %>

View File

@@ -4,7 +4,7 @@ module Danbooru
class Configuration class Configuration
# The version of this Danbooru. # The version of this Danbooru.
def version def version
"2.49.0" "2.50.1"
end end
# The name of this Danbooru. # The name of this Danbooru.