feat: ComicInfo.xml support for CBX files (#1073)

* write, read ComicInfo.xml for CBZ files

* updated with recommendations from previous PR https://github.com/booklore-app/booklore/pull/1069

* read ComicInfo.xml on CBR, extract first image for CBZ/CBR files, save CBR metadata in ComicInfo.xml as CBZ

* Delete CBR file after CBZ conversion. Update DB

* Backs up file before updating. Restores back up if errored

* Test classes

* Update booklore-api/src/main/java/com/adityachandel/booklore/service/metadata/BookMetadataUpdater.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update booklore-api/src/main/java/com/adityachandel/booklore/service/metadata/writer/CbxMetadataWriter.java

Updating RAR binary availability check

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update booklore-api/src/main/java/com/adityachandel/booklore/service/metadata/extractor/CbxMetadataExtractor.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update booklore-api/src/main/java/com/adityachandel/booklore/service/metadata/extractor/CbxMetadataExtractor.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Code updates from PR suggestions

* Support to extract ComicInfo.xml for .cb7 files

* Writer extension for .cb7 files

* Adding com.github.junrar to build.gradle (forgot in previous commit)

* Settings toggle to control CBR/CB7 to CBZ conversion

* indentation complains

* removed duplicated junrar inport

* Restore comicinfo.xml metadata in edit view

* retrieve ComicInfo.xml metadata for new files in library scan

* private class definition was missed after merge

* Delete 

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ruben GM
2025-09-09 08:16:29 -06:00
committed by GitHub
co-authored by Copilot
parent 0fcf4d7813
commit 2e537bb2a1
18 changed files with 1951 additions and 312 deletions
@@ -23,6 +23,23 @@
</div>
</div>
<div class="setting-item">
<div class="setting-info">
<div class="setting-label-row">
<label class="setting-label">Convert CBR/CB7 to CBZ</label>
<p-toggleswitch
[ngModel]="metadataPersistence.convertCbrCb7ToCbz"
(onChange)="onPersistenceToggle('convertCbrCb7ToCbz')"
[disabled]="!metadataPersistence.saveToOriginalFile">
</p-toggleswitch>
</div>
<p class="setting-description">
<i class="pi pi-info-circle"></i>
Converts CBR and CB7 files to CBZ format when updating metadata. If disabled, edits to CBR/CB7 files will not be written to the original file.
</p>
</div>
</div>
<div class="setting-item">
<div class="setting-info">
<div class="setting-label-row">
@@ -20,6 +20,7 @@ export class MetadataPersistenceSettingsComponent implements OnInit {
metadataPersistence: MetadataPersistenceSettings = {
saveToOriginalFile: false,
convertCbrCb7ToCbz: false,
backupMetadata: true,
backupCover: true
};
@@ -62,6 +63,7 @@ export class MetadataPersistenceSettingsComponent implements OnInit {
this.metadataPersistence.saveToOriginalFile = !this.metadataPersistence.saveToOriginalFile;
if (!this.metadataPersistence.saveToOriginalFile) {
this.metadataPersistence.convertCbrCb7ToCbz = false;
this.metadataPersistence.backupMetadata = false;
this.metadataPersistence.backupCover = false;
}