mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-04 20:05:29 -04:00
Optionally pass in db path for testing
This commit is contained in:
parent
049bd3ab2c
commit
7448592216
@ -80,7 +80,7 @@ module MangaDex
|
||||
|
||||
class Queue
|
||||
property downloader : Downloader?
|
||||
@path : String = Config.current.mangadex["download_queue_db_path"].to_s
|
||||
@path : String
|
||||
|
||||
def self.default
|
||||
unless @@default
|
||||
@ -89,7 +89,8 @@ module MangaDex
|
||||
@@default.not_nil!
|
||||
end
|
||||
|
||||
def initialize
|
||||
def initialize(db_path : String? = nil)
|
||||
@path = db_path || Config.current.mangadex["download_queue_db_path"].to_s
|
||||
dir = File.dirname @path
|
||||
unless Dir.exists? dir
|
||||
Logger.info "The queue DB directory #{dir} does not exist. " \
|
||||
|
@ -13,7 +13,7 @@ def verify_password(hash, pw)
|
||||
end
|
||||
|
||||
class Storage
|
||||
@path : String = Config.current.db_path
|
||||
@path : String
|
||||
|
||||
def self.default
|
||||
unless @@default
|
||||
@ -22,7 +22,8 @@ class Storage
|
||||
@@default.not_nil!
|
||||
end
|
||||
|
||||
def initialize
|
||||
def initialize(db_path : String? = nil)
|
||||
@path = db_path || Config.current.db_path
|
||||
dir = File.dirname @path
|
||||
unless Dir.exists? dir
|
||||
Logger.info "The DB directory #{dir} does not exist. " \
|
||||
|
Loading…
x
Reference in New Issue
Block a user