Skip to content

FEATURE: Embed Library metadata into Book Files (Comicbook.xml)#261

Merged
maforget merged 37 commits into
devfrom
comicbookXML
Jun 3, 2026
Merged

FEATURE: Embed Library metadata into Book Files (Comicbook.xml)#261
maforget merged 37 commits into
devfrom
comicbookXML

Conversation

@maforget

@maforget maforget commented May 25, 2026

Copy link
Copy Markdown
Owner

Added functionality to Embed Library metadata into Book Files

  • It adds a new file named ComicBook.xml, that doesn't interfere with the ComicInfo.xml.
  • Contains most of the extra data only available in the library like Read Progress, Custom Value or Color Adjustments.
  • The ComicInfo.xml will always take precedence even if a ComicBook.xml contents differ. It will only keep the extra values part not part of ComicInfo.xml. Since other programs also use the ComicInfo.xml file, this makes sure you always have the most up-to-date information.
  • There is a new setting in Export Profiles Settings called "Embed Library Info" that will create the ComicBook.xml on Export (disabled by default).
  • There is a new setting in the Preferences called "Allow writing of Library info into files" required if your want the new ComicBook.xml to be included during an update.
  • Enabling the "Allow writing of Library info into files" option will enable the "Catalog" & "Custom" tabs in the Info dialog in the "Folder" tab.
  • If you want to ignore reading the ComicBook.xml file completely, there is an option in the ComicRack.ini file (IgnoreEmbeddedComicBookXml).
  • NTFS Streams (ComicRackBook) & Sidecar metadata files have also been added.
  • For the XML Book Information export, if "Embed Library Info" is enabled it will output a ComicBook.xml, otherwise a regular ComicInfo.xml.
  • For the others export format both are embedded when "Embed Library Info" is enabled.
  • Adds a new ComicBookIsDirty to track the changes exclusive to ComicBook.
  • Added ComicBookModifiedBookInfoMatcher ("Modified Library Info" smart list field) to check for ComicBookIsDirty. It isn't part of the default "Files to Update" smart list, must be added manually.

NOTE: Not all ComicBook field are tracked for ComicBookIsDirty
Properties Tracked:
- ReleasedTime
- Rating
- ColorAdjustment
- SeriesComplete
- BookPrice
- BookAge
- BookCondition
- BookStore
- BookOwner
- BookCollectionStatus
- BookNotes
- BookLocation
- ISBN
- CustomValuesStore

Ref: #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.xml but the original file in the Library had potentially lost it's value.

maforget added 18 commits May 25, 2026 02:58
- 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.
@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown

Build Successful! You can find a link to the downloadable artifact below.

Name Link
Commit 09db60f
Logs https://github.com/maforget/ComicRackCE/actions/runs/26686276213
Download https://nightly.link/maforget/ComicRackCE/suites/71531704475/artifacts/7308873704

@maforget

maforget commented May 26, 2026

Copy link
Copy Markdown
Owner Author

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.

Property Note
Id related to Library
AddedTime Included in ComicBook.xml, but changes does not trigger dirty flag
ReleasedTime Change triggers dirty flag
OpenedTime Included in ComicBook.xml, but changes too often to trigger the dirty flag
OpenedCount Included in ComicBook.xml, but changes too often to trigger the dirty flag
CurrentPage Included in ComicBook.xml, but changes too often to trigger the dirty flag
LastPageRead Included in ComicBook.xml, but changes too often to trigger the dirty flag
Rating Change triggers dirty flag
ColorAdjustment Change triggers dirty flag
EnableProposed Included in ComicBook.xml, but changes does not trigger dirty flag
SeriesComplete Change triggers dirty flag
Checked Included in ComicBook.xml, but changes does not trigger dirty flag
ComicInfoIsDirty irrelevant
ComicBookIsDirty irrelevant
FilePath file dependant
FileSize file dependant
FileIsMissing file dependant
FileModifiedTime file dependant
FileCreationTime file dependant
CustomThumbnailKey related to Library
LastOpenedFromListId related to Library
BookPrice Change triggers dirty flag
BookAge Change triggers dirty flag
BookCondition Change triggers dirty flag
BookStore Change triggers dirty flag
BookOwner Change triggers dirty flag
BookCollectionStatus Change triggers dirty flag
BookNotes Change triggers dirty flag
BookLocation Change triggers dirty flag
ISBN Change triggers dirty flag
IsDynamicSource related to dynamic source (web comics), not supported
EnableDynamicUpdate related to dynamic source (web comics), not supported
NewPages related to dynamic source (web comics), not supported
ExtraSyncInformation related to sync
CustomValuesStore Change triggers dirty flag

Bold properties are always added to the ComicBook.xml file. Those in Italic are not tracked via the ComicBookIsDirty flag. The ones with striketrough are never included in the ComicBook.xml or tracked.

maforget added 4 commits May 26, 2026 13:35
- 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.
maforget added 2 commits May 28, 2026 16:32
- Introduced ComicBookModifiedBookInfoMatcher to detect unsaved changes in comic books.
@maforget

maforget commented May 28, 2026

Copy link
Copy Markdown
Owner Author

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.

@maforget

Copy link
Copy Markdown
Owner Author

Also note that testing this build will prevent you from getting update notification when the nightly is updated.

maforget added 6 commits May 28, 2026 18:40
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.
@maforget maforget mentioned this pull request May 29, 2026
@maforget
maforget merged commit 55ac3dc into dev Jun 3, 2026
1 check passed
@maforget
maforget deleted the comicbookXML branch June 3, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant