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() {
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;
}
}

View File

@@ -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

View File

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

View File

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