diff --git a/src/Main.php b/src/Main.php
index 216fbb2..0119ba4 100644
--- a/src/Main.php
+++ b/src/Main.php
@@ -1,4 +1,5 @@
- <<<'TWIG'
{{ description }}
-
Chapters: {{ chapters ?? 1 }}
-
Word count: {{ words }}
-
Published: {{ publishDate }}
-
Last update: {{ lastUpdateDate ?? publishDate }}
-
Status: {{ status }}
-
Rated: {{ rated }}
-
Genre: {{ genre }}
-
Pairings: {{ characters }}
-
Source link:{{ url }}
-
Exported by: {{ exportedBy }})
+
Chapters: {{ chapters ?? 1 }}
+
Word count: {{ words }}
+
Published: {{ publishDate }}
+
Last update: {{ lastUpdateDate ?? publishDate }}
+
Status: {{ status }}
+
Rated: {{ rated }}
+
Genre: {{ genre }}
+
Pairings: {{ characters }}
+
Source link:{{ url|default(' ') }}
+
Exported by: {{ exportedBy }}
TWIG
,
@@ -260,7 +261,7 @@ EOF
/**
* Execute the command
*
- * @param InputInterface $input The command line input
+ * @param InputInterface $input The command line input
* @param OutputInterface $output The command line output
*
* @return int The command exit status code
@@ -318,7 +319,7 @@ EOF
/**
* Process a file
*
- * @param SplFileInfo $file The file
+ * @param SplFileInfo $file The file
* @param OutputInterface $output The command line output
*
* @return void
@@ -386,7 +387,7 @@ EOF
//endregion
//region Meta "container" file: root file path
- $metaContainerPath = 'META-INF' . DIRECTORY_SEPARATOR . 'container.xml';
+ $metaContainerPath = 'META-INF/container.xml';
$output->writeln('Processing meta "container": ' . $metaContainerPath, OutputInterface::VERBOSITY_VERBOSE);
//region Read and parse
@@ -476,11 +477,72 @@ EOF
return;
}
//endregion
+ //region Delete description if present
+ //region Deletion form DOM
+ $rootFileDirty = false;
+ /** @noinspection HttpUrlsUsage */
+ $rootFileXPath->registerNamespace('dc', 'http://purl.org/dc/elements/1.1/');
+ if (($descriptionNodeList = $rootFileXPath->query('/r:package/r:metadata/dc:description')) !== false && $descriptionNodeList->count() > 0) {
+ $output->writeln($descriptionNodeList->count() . ' descriptions found → removing', OutputInterface::VERBOSITY_VERBOSE);
+ /** @var DOMNode $descriptionNode */
+ foreach ($descriptionNodeList as $descriptionNode) {
+ $descriptionNode->parentNode->removeChild($descriptionNode);
+ $rootFileDirty = true;
+ }
+ }
+ else {
+ $output->writeln('no descriptions found', OutputInterface::VERBOSITY_VERBOSE);
+ }
+ //endregion
+ //region Overwrite root file in ZIP
+ if ($rootFileDirty) {
+ //region Get temporary TOC file
+ $rootFilePathTemp = sys_get_temp_dir() . DIRECTORY_SEPARATOR . basename($rootFilePath);
+ $output->writeln('Temporary TOC file path: ' . $rootFilePathTemp, OutputInterface::VERBOSITY_VERBOSE);
+
+ if (file_exists($rootFilePathTemp)) {
+ if (!unlink($rootFilePathTemp)) {
+ $output->writeln('