mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 03:15:31 -04:00
Rescan only if instance loaded
This commit is contained in:
parent
80e13abc4a
commit
e6214ddc5d
@ -29,22 +29,26 @@ class Library
|
|||||||
zip_file.close
|
zip_file.close
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
is_loaded = false
|
||||||
begin
|
begin
|
||||||
instance_file.open do |content|
|
instance_file.open do |content|
|
||||||
@@default = Library.from_yaml content
|
@@default = Library.from_yaml content
|
||||||
end
|
end
|
||||||
|
is_loaded = true
|
||||||
rescue e
|
rescue e
|
||||||
Logger.error e
|
Logger.error e
|
||||||
end
|
end
|
||||||
|
|
||||||
zip_file.close
|
zip_file.close
|
||||||
|
|
||||||
spawn do
|
if is_loaded
|
||||||
start = Time.local
|
spawn do
|
||||||
Library.default.scan
|
start = Time.local
|
||||||
ms = (Time.local - start).total_milliseconds
|
Library.default.scan
|
||||||
Logger.info "Re-scanned #{Library.default.title_ids.size} titles \
|
ms = (Time.local - start).total_milliseconds
|
||||||
in #{ms}ms"
|
Logger.info "Re-scanned #{Library.default.title_ids.size} titles \
|
||||||
|
in #{ms}ms"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user