X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/c2103994301a743b0e3e620da80d795124d9ec47..971e08cc34959303fbbc8bc50742c9fbe1d66f53:/src/depot/legimi.py diff --git a/src/depot/legimi.py b/src/depot/legimi.py index f61bbfd9..464eecad 100644 --- a/src/depot/legimi.py +++ b/src/depot/legimi.py @@ -184,13 +184,18 @@ class Legimi: base_url='file://' + book.gallery_path() + '/' ).build(wlbook).get_file() + thema = [] + if meta.thema_main: + thema.append(meta.thema_main) + thema.extend(meta.thema) + book_data = { "Title": meta.title, "Author": ", ".join(p.readable() for p in meta.authors), "Year": str(date.today().year), 'GenreId': str(self.get_genre(wlbook)), - 'themaCategories': ';'.join(meta.thema), + 'themaCategories': ';'.join(thema), 'thema-search': '', 'Isbn': '', 'LanguageLocale': lang_code_3to2(meta.language), @@ -289,12 +294,13 @@ class Legimi: for p in wlbook.meta.genres ) + '

' - if wlbook.meta.audience: + # TODO: Move away from using audiences for this. + if wlbook.meta.audience in ('L', 'SP1', 'SP2', 'SP3', 'SP4'): description += '

{} to lektura szkolna.'.format(wlbook.meta.title) if wlbook.tree.find('//pe') is not None: description += '
Ebook {title} zawiera przypisy opracowane specjalnie dla uczennic i uczniów {school}.'.format( title=wlbook.meta.title, - school='szkoły podstawowej' if wlbook.meta.audience == 'SP' else 'liceum i technikum' + school='szkoły podstawowej' if wlbook.meta.audience.startswith('SP') else 'liceum i technikum' ) description += '

' return description