mirror of https://github.com/kiwix/libkiwix.git
Got rid of <content> node in languages OPDS entry
This commit is contained in:
parent
96cf7e78a5
commit
45adda44b3
|
@ -93,15 +93,6 @@ std::string getLanguageSelfName(const std::string& lang) {
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string getLanguageEnglishName(const std::string& lang) {
|
|
||||||
const icu::Locale locale(lang.c_str());
|
|
||||||
icu::UnicodeString ustring;
|
|
||||||
locale.getDisplayLanguage(icu::Locale("en"), ustring);
|
|
||||||
std::string result;
|
|
||||||
ustring.toUTF8String(result);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // unnamed namespace
|
} // unnamed namespace
|
||||||
|
|
||||||
string OPDSDumper::dumpOPDSFeed(const std::vector<std::string>& bookIds, const std::string& query) const
|
string OPDSDumper::dumpOPDSFeed(const std::vector<std::string>& bookIds, const std::string& query) const
|
||||||
|
@ -171,11 +162,9 @@ std::string OPDSDumper::languagesOPDSFeed() const
|
||||||
kainjow::mustache::list languageData;
|
kainjow::mustache::list languageData;
|
||||||
for ( const auto& languageCode : library->getBooksLanguages() ) {
|
for ( const auto& languageCode : library->getBooksLanguages() ) {
|
||||||
const auto languageSelfName = getLanguageSelfName(languageCode);
|
const auto languageSelfName = getLanguageSelfName(languageCode);
|
||||||
const auto languageEnglishName = getLanguageEnglishName(languageCode);
|
|
||||||
languageData.push_back(kainjow::mustache::object{
|
languageData.push_back(kainjow::mustache::object{
|
||||||
{"lang_code", languageCode},
|
{"lang_code", languageCode},
|
||||||
{"lang_self_name", languageSelfName},
|
{"lang_self_name", languageSelfName},
|
||||||
{"lang_english_name", languageEnglishName},
|
|
||||||
{"updated", now},
|
{"updated", now},
|
||||||
{"id", gen_uuid(libraryId + "/languages/" + languageCode)}
|
{"id", gen_uuid(libraryId + "/languages/" + languageCode)}
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
|
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
|
||||||
<updated>{{updated}}</updated>
|
<updated>{{updated}}</updated>
|
||||||
<id>{{id}}</id>
|
<id>{{id}}</id>
|
||||||
<content type="text">All entries in {{lang_english_name}}.</content>
|
|
||||||
</entry>
|
</entry>
|
||||||
{{/languages}}
|
{{/languages}}
|
||||||
</feed>
|
</feed>
|
||||||
|
|
|
@ -1040,7 +1040,6 @@ TEST_F(LibraryServerTest, catalog_v2_languages)
|
||||||
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
|
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
|
||||||
<updated>YYYY-MM-DDThh:mm:ssZ</updated>
|
<updated>YYYY-MM-DDThh:mm:ssZ</updated>
|
||||||
<id>12345678-90ab-cdef-1234-567890abcdef</id>
|
<id>12345678-90ab-cdef-1234-567890abcdef</id>
|
||||||
<content type="text">All entries in English.</content>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<title>français</title>
|
<title>français</title>
|
||||||
|
@ -1050,7 +1049,6 @@ TEST_F(LibraryServerTest, catalog_v2_languages)
|
||||||
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
|
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
|
||||||
<updated>YYYY-MM-DDThh:mm:ssZ</updated>
|
<updated>YYYY-MM-DDThh:mm:ssZ</updated>
|
||||||
<id>12345678-90ab-cdef-1234-567890abcdef</id>
|
<id>12345678-90ab-cdef-1234-567890abcdef</id>
|
||||||
<content type="text">All entries in French.</content>
|
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<title>русский</title>
|
<title>русский</title>
|
||||||
|
@ -1060,7 +1058,6 @@ TEST_F(LibraryServerTest, catalog_v2_languages)
|
||||||
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
|
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
|
||||||
<updated>YYYY-MM-DDThh:mm:ssZ</updated>
|
<updated>YYYY-MM-DDThh:mm:ssZ</updated>
|
||||||
<id>12345678-90ab-cdef-1234-567890abcdef</id>
|
<id>12345678-90ab-cdef-1234-567890abcdef</id>
|
||||||
<content type="text">All entries in Russian.</content>
|
|
||||||
</entry>
|
</entry>
|
||||||
</feed>
|
</feed>
|
||||||
)";
|
)";
|
||||||
|
|
Loading…
Reference in New Issue