Skip to content

Commit

Permalink
Remove OriginId functions since they are not useful right now
Browse files Browse the repository at this point in the history
  • Loading branch information
maneeshpm committed Jul 7, 2021
1 parent b50a2a2 commit 8eeef00
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 42 deletions.
10 changes: 0 additions & 10 deletions include/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,6 @@ class Reader
*/
string getScraper() const;

/**
* Get the origId of the zim file.
*
* The origId is only used in the case of patch zim file and is the Id
* of the original zim file.
*
* @return The origId of the zim file as specified in the zim metadata.
*/
string getOrigId() const;

/**
* Get the favicon of the zim file.
*
Expand Down
5 changes: 0 additions & 5 deletions src/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,6 @@ string Reader::getScraper() const
}
#undef METADATA

string Reader::getOrigId() const
{
return kiwix::getArchiveOrigId(*zimArchive);
}

Entry Reader::getEntryFromPath(const std::string& path) const
{
try {
Expand Down
27 changes: 1 addition & 26 deletions src/tools/archiveTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,32 +94,7 @@ std::string getMetaFlavour(const zim::Archive& archive) {
}

std::string getArchiveId(const zim::Archive& archive) {
std::ostringstream s;
s << archive.getUuid();
return s.str();
}

std::string getArchiveOrigId(const zim::Archive& archive) {
std::string value = getMetadata(archive, "startfileuid");
if (value.empty()) {
return "";
}
std::string id = value;
std::string origID;
std::string temp = "";
unsigned int k = 0;
char tempArray[16] = "";
for (unsigned int i = 0; i < id.size(); i++) {
if (id[i] == '\n') {
tempArray[k] = atoi(temp.c_str());
temp = "";
k++;
} else {
temp += id[i];
}
}
origID = (std::string) zim::Uuid::generate(tempArray);
return origID;
return (std::string) archive.getUuid();
}

bool getArchiveFavicon(const zim::Archive& archive,
Expand Down
1 change: 0 additions & 1 deletion src/tools/archiveTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ namespace kiwix
std::string getMetaPublisher(const zim::Archive& archive);
std::string getMetaFlavour(const zim::Archive& archive);
std::string getArchiveId(const zim::Archive& archive);
std::string getArchiveOrigId(const zim::Archive& archive);

bool getArchiveFavicon(const zim::Archive& archive,
std::string& content, std::string& mimeType);
Expand Down

0 comments on commit 8eeef00

Please sign in to comment.