FEATURE: Embed Library metadata into Book Files (Comicbook.xml)#261
Conversation
- Refactored `ComicBook` and `ComicExporter` to support serialization and embedding of `ComicBook` objects as `ComicBook.xml`. - Modified `PackedStorageProvider` to handle `ComicBook.xml` embedding. - Introduced `EmbedComicBook` property in `StorageSetting` with default `false`.
- Excluded unnecessary metadata (file paths and timestamps) from the exported `ComicBook.xml` by setting default values for `Id`, `FilePath`, `FileModifiedTime`, `FileCreationTime`, `AddedTime` and `FileSize`.
For testing until we have added UI elements
- Need to find a way to do both at the same time - Figure out what to do with the the info being dirty and the new properties. Currently it's only linked to ComicInfo value being changed. Otherwise it would trigger just for reading a book.
When updating using 7-zip the file is replaced so you lose any NTFS stream on it. So the first added is never kept in NTFS. Since we want to make sure that ComicInfo is there at least we add it last. Need to do both update at the same time.
Detects if the type is a ComicBook and update the appropriate file/NTFS stream instead. Removed StoreBook/WriteBook not required anymore
Enables the creation of ComicBook.xml that contains additionnal information in the book files when updating.
|
Build Successful! You can find a link to the downloadable artifact below.
|
Since we are clearing some values to not be included we don't want to inadvertently clear these for the original object. We were counting on the callee on doing so, this makes sure it always does.
…g library info is checked
|
I've made a list of the properties that can be serialized to XML that are exclusive to ComicBook.xml. I've commented on the entries I've excluded in the new file.
Bold properties are always added to the |
- Introduced an optional onlyComicInfo parameter to IsSameContent in ComicInfo and ComicBook for finer control over property comparison. - Updated NtfsInfoStorage.Store to use a full comparison.
- Replaced the isComicInfo boolean with a ComicInfoType enum in BookChangedEventArgs for clearer distinction between ComicInfo and ComicBook changes.
- Updated property setters, SetProperty, and FireBookChanged methods to propagate an includeInComicBook flag, ensuring accurate event notifications.
- Adjusted ComicInfo.cs to use the new enum
- Tracking ComicBook properties:
- ReleasedTime
- Rating
- ColorAdjustment
- SeriesComplete
- BookPrice
- BookAge
- BookCondition
- BookStore
- BookOwner
- BookCollectionStatus
- BookNotes
- BookLocation
- ISBN
- NewPages
- CustomValuesStore
- Introduce ComicBookIsDirty to track modifications to library-level properties separately from ComicInfo changes. - Update export, file update, and UI logic to handle both dirty flags, improving accuracy in change tracking and persistence for comic book data.
- Introduced ComicBookModifiedBookInfoMatcher to detect unsaved changes in comic books.
…dateComicBookFiles is true
|
Caution Do be careful of when trying the new smart list "Modified Library Info". Having new matchers in your library WILL result in data lost when opened with older versions where they don't exists. So if you try the test build with your library and add the new matcher, then do back to the regular nightly branch that hasn't been updated yet, your library will reset. So when trying test builds ALWAYS maintain backups or be aware you might need to manually modify files to from the Corrupted backup done when it resets. |
|
Also note that testing this build will prevent you from getting update notification when the nightly is updated. |
Shouldn't have been there.
They refer to webcomics and they aren't supported for embedding data to them
Refined the condition for setting ComicBookIsDirty to exclude dynamic sources, ensuring the dirty flag is only set for regular books. This prevents unnecessary updates for web comics since embedding isn't supported for this type anyway.
Added functionality to Embed Library metadata into Book Files
ComicBook.xml, that doesn't interfere with theComicInfo.xml.ComicInfo.xmlwill always take precedence even if aComicBook.xmlcontents differ. It will only keep the extra values part not part ofComicInfo.xml. Since other programs also use theComicInfo.xmlfile, this makes sure you always have the most up-to-date information.ComicBook.xmlon Export (disabled by default).ComicBook.xmlto be included during an update.ComicBook.xmlfile completely, there is an option in theComicRack.inifile (IgnoreEmbeddedComicBookXml).ComicRackBook) & Sidecar metadata files have also been added.ComicBook.xml, otherwise a regularComicInfo.xml.ComicBookIsDirtyto track the changes exclusive toComicBook.ComicBookModifiedBookInfoMatcher("Modified Library Info" smart list field) to check forComicBookIsDirty. It isn't part of the default "Files to Update" smart list, must be added manually.NOTE: Not all
ComicBookfield are tracked forComicBookIsDirtyProperties Tracked:
-
ReleasedTime-
Rating-
ColorAdjustment-
SeriesComplete-
BookPrice-
BookAge-
BookCondition-
BookStore-
BookOwner-
BookCollectionStatus-
BookNotes-
BookLocation-
ISBN-
CustomValuesStoreRef: #260
NOTE: Something to check for, I had an instance of some Custom Values in my Library disappearing. Unsure how it happened or if it's even an issue. The exported copy of the book I used to test had the custom values properly stored in the
ComicBook.xmlbut the original file in the Library had potentially lost it's value.