mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Rescan only if instance loaded
This commit is contained in:
parent
80e13abc4a
commit
e6214ddc5d
@ -29,16 +29,19 @@ 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
|
||||||
|
|
||||||
|
if is_loaded
|
||||||
spawn do
|
spawn do
|
||||||
start = Time.local
|
start = Time.local
|
||||||
Library.default.scan
|
Library.default.scan
|
||||||
@ -47,6 +50,7 @@ class Library
|
|||||||
in #{ms}ms"
|
in #{ms}ms"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
register_mime_types
|
register_mime_types
|
||||||
|
Loading…
x
Reference in New Issue
Block a user