mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Move common code to Queue::Downloader
This commit is contained in:
parent
ae7c72ab85
commit
b75a838e14
@ -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
|
||||
|
@ -1,7 +1,5 @@
|
||||
class Plugin
|
||||
class Downloader < Queue::Downloader
|
||||
@library_path : String = Config.current.library_path
|
||||
@downloading = false
|
||||
|
||||
def self.default : self
|
||||
unless @@default
|
||||
@ -11,8 +9,7 @@ class Plugin
|
||||
end
|
||||
|
||||
def initialize
|
||||
@queue = Queue.default
|
||||
@queue << self
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,8 +1,16 @@
|
||||
require "sqlite3"
|
||||
require "./util/*"
|
||||
|
||||
class Queue
|
||||
class Downloader
|
||||
property stopped = false
|
||||
@library_path : String = Config.current.library_path
|
||||
@downloading = false
|
||||
|
||||
def initialize
|
||||
@queue = Queue.default
|
||||
@queue << self
|
||||
end
|
||||
end
|
||||
|
||||
class PageJob
|
||||
|
Loading…
x
Reference in New Issue
Block a user