Add MangaDex::Queue to Context

This commit is contained in:
Alex Ling 2020-02-28 17:37:08 +00:00
parent f11a5cd608
commit d3d8dff6d2
2 changed files with 7 additions and 2 deletions

View File

@ -8,8 +8,9 @@ class Context
property library : Library
property storage : Storage
property logger : MLogger
property queue : MangaDex::Queue
def initialize(@config, @logger, @library, @storage)
def initialize(@config, @logger, @library, @storage, @queue)
end
{% for lvl in LEVELS %}

View File

@ -1,5 +1,6 @@
require "./server"
require "./context"
require "./mangadex/*"
require "option_parser"
VERSION = "0.1.0"
@ -27,8 +28,11 @@ config = Config.load config_path
logger = MLogger.new config
storage = Storage.new config.db_path, logger
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.start