mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-25 00:00:52 -04:00
Merge branch 'dev' into feature/preserve-scanned-titles
This commit is contained in:
+2
-11
@@ -100,14 +100,14 @@ class Library
|
||||
titles.flat_map &.deep_entries
|
||||
end
|
||||
|
||||
def to_slim_json : String
|
||||
def build_json(*, slim = false, shallow = false)
|
||||
JSON.build do |json|
|
||||
json.object do
|
||||
json.field "dir", @dir
|
||||
json.field "titles" do
|
||||
json.array do
|
||||
self.titles.each do |title|
|
||||
json.raw title.to_slim_json
|
||||
json.raw title.build_json(slim: slim, shallow: shallow)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -115,15 +115,6 @@ class Library
|
||||
end
|
||||
end
|
||||
|
||||
def to_json(json : JSON::Builder)
|
||||
json.object do
|
||||
json.field "dir", @dir
|
||||
json.field "titles" do
|
||||
json.raw self.titles.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def get_title(tid)
|
||||
@title_hash[tid]?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user