Skip to content

Commit

Permalink
Got rid of <content> node in languages OPDS entry
Browse files Browse the repository at this point in the history
  • Loading branch information
veloman-yunkan authored and kelson42 committed Jul 31, 2021
1 parent 89e0958 commit a316466
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
11 changes: 0 additions & 11 deletions src/opds_dumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,6 @@ std::string getLanguageSelfName(const std::string& lang) {
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

string OPDSDumper::dumpOPDSFeed(const std::vector<std::string>& bookIds, const std::string& query) const
Expand Down Expand Up @@ -171,11 +162,9 @@ std::string OPDSDumper::languagesOPDSFeed() const
kainjow::mustache::list languageData;
for ( const auto& languageCode : library->getBooksLanguages() ) {
const auto languageSelfName = getLanguageSelfName(languageCode);
const auto languageEnglishName = getLanguageEnglishName(languageCode);
languageData.push_back(kainjow::mustache::object{
{"lang_code", languageCode},
{"lang_self_name", languageSelfName},
{"lang_english_name", languageEnglishName},
{"updated", now},
{"id", gen_uuid(libraryId + "/languages/" + languageCode)}
});
Expand Down
1 change: 0 additions & 1 deletion static/templates/catalog_v2_languages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
<updated>{{updated}}</updated>
<id>{{id}}</id>
<content type="text">All entries in {{lang_english_name}}.</content>
</entry>
{{/languages}}
</feed>
3 changes: 0 additions & 3 deletions test/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,6 @@ TEST_F(LibraryServerTest, catalog_v2_languages)
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
<updated>YYYY-MM-DDThh:mm:ssZ</updated>
<id>12345678-90ab-cdef-1234-567890abcdef</id>
<content type="text">All entries in English.</content>
</entry>
<entry>
<title>français</title>
Expand All @@ -1050,7 +1049,6 @@ TEST_F(LibraryServerTest, catalog_v2_languages)
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
<updated>YYYY-MM-DDThh:mm:ssZ</updated>
<id>12345678-90ab-cdef-1234-567890abcdef</id>
<content type="text">All entries in French.</content>
</entry>
<entry>
<title>русский</title>
Expand All @@ -1060,7 +1058,6 @@ TEST_F(LibraryServerTest, catalog_v2_languages)
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
<updated>YYYY-MM-DDThh:mm:ssZ</updated>
<id>12345678-90ab-cdef-1234-567890abcdef</id>
<content type="text">All entries in Russian.</content>
</entry>
</feed>
)";
Expand Down

0 comments on commit a316466

Please sign in to comment.