Merge branch 'master' of https://github.com/r888888888/danbooru
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user