mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Add MangaDex::Queue to Context
This commit is contained in:
parent
f11a5cd608
commit
d3d8dff6d2
@ -8,8 +8,9 @@ class Context
|
|||||||
property library : Library
|
property library : Library
|
||||||
property storage : Storage
|
property storage : Storage
|
||||||
property logger : MLogger
|
property logger : MLogger
|
||||||
|
property queue : MangaDex::Queue
|
||||||
|
|
||||||
def initialize(@config, @logger, @library, @storage)
|
def initialize(@config, @logger, @library, @storage, @queue)
|
||||||
end
|
end
|
||||||
|
|
||||||
{% for lvl in LEVELS %}
|
{% for lvl in LEVELS %}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
require "./server"
|
require "./server"
|
||||||
require "./context"
|
require "./context"
|
||||||
|
require "./mangadex/*"
|
||||||
require "option_parser"
|
require "option_parser"
|
||||||
|
|
||||||
VERSION = "0.1.0"
|
VERSION = "0.1.0"
|
||||||
@ -27,8 +28,11 @@ config = Config.load config_path
|
|||||||
logger = MLogger.new config
|
logger = MLogger.new config
|
||||||
storage = Storage.new config.db_path, logger
|
storage = Storage.new config.db_path, logger
|
||||||
library = Library.new config.library_path, config.scan_interval, logger, storage
|
library = Library.new config.library_path, config.scan_interval, logger, storage
|
||||||
|
queue = MangaDex::Queue.new config.mangadex["download_queue_db_path"].to_s
|
||||||
|
api = MangaDex::API.new config.mangadex["api_url"].to_s
|
||||||
|
downloader = MangaDex::Downloader.new queue, api, config.library_path, config.mangadex["download_wait_seconds"].to_i, config.mangadex["download_retries"].to_i
|
||||||
|
|
||||||
context = Context.new config, logger, library, storage
|
context = Context.new config, logger, library, storage, queue
|
||||||
|
|
||||||
server = Server.new context
|
server = Server.new context
|
||||||
server.start
|
server.start
|
||||||
|
Loading…
x
Reference in New Issue
Block a user