Move common code to Queue::Downloader

This commit is contained in:
Alex Ling
2020-07-21 12:32:48 +00:00
parent ae7c72ab85
commit b75a838e14
3 changed files with 10 additions and 9 deletions

View File

@@ -3,12 +3,9 @@ require "zip"
module MangaDex
class Downloader < Queue::Downloader
property stopped = false
@wait_seconds : Int32 = Config.current.mangadex["download_wait_seconds"]
.to_i32
@retries : Int32 = Config.current.mangadex["download_retries"].to_i32
@library_path : String = Config.current.library_path
@downloading = false
def self.default : self
unless @@default
@@ -18,9 +15,8 @@ module MangaDex
end
def initialize
@queue = Queue.default
super
@api = API.default
@queue << self
spawn do
loop do