Simplify Title.new

This commit is contained in:
Alex Ling 2021-09-15 09:00:30 +00:00
parent 2c241a96bb
commit 44a6f822cd

View File

@ -19,7 +19,7 @@ class Title
@[YAML::Field(ignore: true)] @[YAML::Field(ignore: true)]
@cached_cover_url : String? @cached_cover_url : String?
def initialize(@dir : String, @parent_id, cache : Hash(String, String)?) def initialize(@dir : String, @parent_id, cache : Hash(String, String)? = nil)
storage = Storage.default storage = Storage.default
@signature = Dir.signature dir @signature = Dir.signature dir
id = storage.get_title_id dir, signature id = storage.get_title_id dir, signature
@ -70,10 +70,6 @@ class Title
end end
end end
def self.new(dir : String, parent_id)
new dir, parent_id, nil
end
def examine(context : ExamineContext) : Bool def examine(context : ExamineContext) : Bool
return false unless Dir.exists? @dir # No title, Remove this return false unless Dir.exists? @dir # No title, Remove this
contents_signature = Dir.contents_signature @dir, contents_signature = Dir.contents_signature @dir,