mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 10:55:30 -04:00
Fix bug: remove titles not in root library anymore
This commit is contained in:
parent
921628ba6d
commit
cc33fa6595
@ -136,8 +136,12 @@ class Library
|
||||
deleted_entry_ids: [] of String,
|
||||
}
|
||||
|
||||
library_paths = (Dir.entries @dir)
|
||||
.select { |fn| !fn.starts_with? "." }
|
||||
.map { |fn| File.join @dir, fn }
|
||||
@title_ids.select! do |title_id|
|
||||
title = @title_hash[title_id]
|
||||
next false unless library_paths.includes? title.dir
|
||||
existence = title.examine examine_context
|
||||
unless existence
|
||||
examine_context["deleted_title_ids"].concat [title_id] +
|
||||
@ -152,9 +156,7 @@ class Library
|
||||
end
|
||||
|
||||
cache = examine_context["cached_contents_signature"]
|
||||
(Dir.entries @dir)
|
||||
.select { |fn| !fn.starts_with? "." }
|
||||
.map { |fn| File.join @dir, fn }
|
||||
library_paths
|
||||
.select { |path| !(remained_title_dirs.includes? path) }
|
||||
.select { |path| File.directory? path }
|
||||
.map { |path| Title.new path, "", cache }
|
||||
|
Loading…
x
Reference in New Issue
Block a user