Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not try to add twice Illustration. #419

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/zimrecreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@
} catch(...) {}

for(auto& metakey:origin.getMetadataKeys()) {
if (metakey == "Counter" ) {
if (metakey == "Counter" || metakey.find("Illustration_") == 0) {
// Counter is already added by libzim
// Illustration is already handled by `addIllustration`
continue;
}
auto metadata = origin.getMetadata(metakey);
Expand Down Expand Up @@ -176,7 +177,11 @@
"\nOptions:\n"
"\t-v, --version print software version\n"
"\t-j, --withoutFTIndex don't create and add a fulltext index of the content to the ZIM\n"
"\t-J, --threads <number> count of threads to utilize (default: 4)\n";
"\t-J, --threads <number> count of threads to utilize (default: 4)\n"
"\nReturn value:\n"
"- 0 if no error\n"
"- -1 if arguments are not valid\n"
"- -2 if zim creation fails\n";

Check warning on line 184 in src/zimrecreate.cpp

View check run for this annotation

Codecov / codecov/patch

src/zimrecreate.cpp#L184

Added line #L184 was not covered by tests
return;
}

Expand All @@ -187,7 +192,6 @@

//Parsing arguments
//There will be only two arguments, so no detailed parsing is required.
std::cout << "zimrecreate" << std::endl;;
for(int i=0;i<argc;i++)
{
if(std::string(argv[i])=="-H" ||
Expand Down Expand Up @@ -248,5 +252,7 @@
catch (const std::exception& e)
{
std::cerr << e.what() << std::endl;
return -2;

Check warning on line 255 in src/zimrecreate.cpp

View check run for this annotation

Codecov / codecov/patch

src/zimrecreate.cpp#L255

Added line #L255 was not covered by tests
}
return 0;

Check warning on line 257 in src/zimrecreate.cpp

View check run for this annotation

Codecov / codecov/patch

src/zimrecreate.cpp#L257

Added line #L257 was not covered by tests
}
Loading