Skip to content

Commit

Permalink
fixup! Introduce Archive::getMediaCount
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr committed Oct 30, 2022
1 parent 81cc4ce commit ee4c488
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,14 @@ namespace zim

entry_index_type Archive::getMediaCount() const
{
try {
return countMimeType(
getMetadata("Counter"),
[](const std::string& mimetype) {
return mimetype.find("image/") == 0 ||
mimetype.find("video/") == 0 ||
mimetype.find("audio/") == 0;
}
);
} catch(const EntryNotFound& e) {
return 0;
}
return countMimeType(
getMetadata("Counter"),
[](const std::string& mimetype) {
return mimetype.find("image/") == 0 ||
mimetype.find("video/") == 0 ||
mimetype.find("audio/") == 0;
}
);
}

Uuid Archive::getUuid() const
Expand Down

0 comments on commit ee4c488

Please sign in to comment.