Language code in /catalog/v2/languages entries

This commit is contained in:
Veloman Yunkan 2021-06-13 23:34:03 +04:00 committed by Matthieu Gautier
parent 5f90f5ee2a
commit 8a4248e48e
2 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" <feed xmlns="http://www.w3.org/2005/Atom"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:opds="https://specs.opds.io/opds-1.2"> xmlns:opds="https://specs.opds.io/opds-1.2">
<id>{{feed_id}}</id> <id>{{feed_id}}</id>
<link rel="self" <link rel="self"
@ -14,6 +15,7 @@
{{#languages}} {{#languages}}
<entry> <entry>
<title>{{lang_self_name}}</title> <title>{{lang_self_name}}</title>
<dc:language>{{{lang_code}}}</dc:language>
<link rel="subsection" <link rel="subsection"
href="{{endpoint_root}}/entries?lang={{{lang_code}}}" href="{{endpoint_root}}/entries?lang={{{lang_code}}}"
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/> type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>

View File

@ -1020,6 +1020,7 @@ TEST_F(LibraryServerTest, catalog_v2_languages)
EXPECT_EQ(r->status, 200); EXPECT_EQ(r->status, 200);
const char expected_output[] = R"(<?xml version="1.0" encoding="UTF-8"?> const char expected_output[] = R"(<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" <feed xmlns="http://www.w3.org/2005/Atom"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:opds="https://specs.opds.io/opds-1.2"> xmlns:opds="https://specs.opds.io/opds-1.2">
<id>12345678-90ab-cdef-1234-567890abcdef</id> <id>12345678-90ab-cdef-1234-567890abcdef</id>
<link rel="self" <link rel="self"
@ -1033,6 +1034,7 @@ TEST_F(LibraryServerTest, catalog_v2_languages)
<entry> <entry>
<title>English</title> <title>English</title>
<dc:language>eng</dc:language>
<link rel="subsection" <link rel="subsection"
href="/catalog/v2/entries?lang=eng" href="/catalog/v2/entries?lang=eng"
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/> type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
@ -1042,6 +1044,7 @@ TEST_F(LibraryServerTest, catalog_v2_languages)
</entry> </entry>
<entry> <entry>
<title>Français</title> <title>Français</title>
<dc:language>fra</dc:language>
<link rel="subsection" <link rel="subsection"
href="/catalog/v2/entries?lang=fra" href="/catalog/v2/entries?lang=fra"
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/> type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
@ -1051,6 +1054,7 @@ TEST_F(LibraryServerTest, catalog_v2_languages)
</entry> </entry>
<entry> <entry>
<title>Русский</title> <title>Русский</title>
<dc:language>rus</dc:language>
<link rel="subsection" <link rel="subsection"
href="/catalog/v2/entries?lang=rus" href="/catalog/v2/entries?lang=rus"
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/> type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>