From 291a340cdd48b068e71cde78b9cf22227658ecf6 Mon Sep 17 00:00:00 2001 From: Leeingnyo Date: Thu, 9 Sep 2021 20:45:47 +0900 Subject: [PATCH] Add yaml serializer to Library, Title, Entry --- src/library/entry.cr | 2 ++ src/library/library.cr | 2 ++ src/library/title.cr | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/library/entry.cr b/src/library/entry.cr index 28b7122..bb0aa1b 100644 --- a/src/library/entry.cr +++ b/src/library/entry.cr @@ -1,6 +1,8 @@ require "image_size" class Entry + include YAML::Serializable + getter zip_path : String, book : Title, title : String, size : String, pages : Int32, id : String, encoded_path : String, encoded_title : String, mtime : Time, err_msg : String? diff --git a/src/library/library.cr b/src/library/library.cr index 32cc161..9c23d68 100644 --- a/src/library/library.cr +++ b/src/library/library.cr @@ -1,4 +1,6 @@ class Library + include YAML::Serializable + getter dir : String, title_ids : Array(String), title_hash : Hash(String, Title) diff --git a/src/library/title.cr b/src/library/title.cr index f1915d4..899e21f 100644 --- a/src/library/title.cr +++ b/src/library/title.cr @@ -2,6 +2,8 @@ require "digest" require "../archive" class Title + include YAML::Serializable + getter dir : String, parent_id : String, title_ids : Array(String), entries : Array(Entry), title : String, id : String, encoded_title : String, mtime : Time, signature : UInt64,