mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 03:15:31 -04:00
Register mime_type scan, thumbnails when loading instance
This commit is contained in:
parent
7734dae138
commit
f5933a48d9
@ -44,19 +44,11 @@ class Library
|
|||||||
zip_file.close
|
zip_file.close
|
||||||
|
|
||||||
if is_loaded
|
if is_loaded
|
||||||
spawn do
|
Library.default.register_jobs
|
||||||
start = Time.local
|
|
||||||
Library.default.scan
|
|
||||||
ms = (Time.local - start).total_milliseconds
|
|
||||||
Logger.info "Re-scanned #{Library.default.title_ids.size} titles \
|
|
||||||
in #{ms}ms"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
register_mime_types
|
|
||||||
|
|
||||||
@dir = Config.current.library_path
|
@dir = Config.current.library_path
|
||||||
# explicitly initialize @titles to bypass the compiler check. it will
|
# explicitly initialize @titles to bypass the compiler check. it will
|
||||||
# be filled with actual Titles in the `scan` call below
|
# be filled with actual Titles in the `scan` call below
|
||||||
@ -66,6 +58,12 @@ class Library
|
|||||||
@entries_count = 0
|
@entries_count = 0
|
||||||
@thumbnails_count = 0
|
@thumbnails_count = 0
|
||||||
|
|
||||||
|
register_jobs
|
||||||
|
end
|
||||||
|
|
||||||
|
protected def register_jobs
|
||||||
|
register_mime_types
|
||||||
|
|
||||||
scan_interval = Config.current.scan_interval_minutes
|
scan_interval = Config.current.scan_interval_minutes
|
||||||
if scan_interval < 1
|
if scan_interval < 1
|
||||||
scan
|
scan
|
||||||
|
Loading…
x
Reference in New Issue
Block a user