From: Radek Czajka Date: Mon, 28 Feb 2022 14:59:30 +0000 (+0100) Subject: Release with current fixes. X-Git-Tag: 2.3.4 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/753d3a2d605279607ab18018a227b17dd7cb94b3?ds=sidebyside Release with current fixes. --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 0366bf8..d19c282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ This document records all notable changes to Librarian. +## 2.3.4 (2022-02-28) + +### Fixed: +- Document stats totaling bug. +- Legimi cover background position. + + ## 2.3.3 (2021-12-23) ### Added: diff --git a/setup.py b/setup.py index d3c4afe..c89f5a1 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def whole_tree(prefix, path): setup( name='librarian', - version='2.3.3', + version='2.3.4', description='Converter from WolneLektury.pl XML-based language to XHTML, TXT and other formats', author="Marek Stępniowski", author_email='marek@stepniowski.com', diff --git a/src/librarian/cover.py b/src/librarian/cover.py index d9b76ea..dfb0b76 100644 --- a/src/librarian/cover.py +++ b/src/librarian/cover.py @@ -289,6 +289,7 @@ class WLCover(Cover): background_color = '#444' author_color = '#444' background_img = get_resource('res/cover.png') + background_top = False format = 'JPEG' epoch_colors = { @@ -478,7 +479,10 @@ class WLCover(Cover): trg_size[0], int(round(src.size[1] * trg_size[0] / src.size[0])) ) - cut = (resized[1] - trg_size[1]) // 2 + if self.background_top: + cut = 0 + else: + cut = (resized[1] - trg_size[1]) // 2 src = src.resize(resized, Image.ANTIALIAS) src = src.crop((0, cut, src.size[0], src.size[1] - cut)) else: @@ -733,6 +737,7 @@ class LegimiCover(LogoWLCover): ] logos_right = False gradient_logo_centering = True + background_top = True genre_colors = { 'Artykuł': '#bf001a', diff --git a/src/librarian/parser.py b/src/librarian/parser.py index 8adde33..c00785a 100644 --- a/src/librarian/parser.py +++ b/src/librarian/parser.py @@ -115,7 +115,7 @@ class WLDocument(object): else: data['parts'].append((part, part.get_statistics())) for k, v in data['parts'][-1][1]['total'].items(): - data['total'][k] += v + data['total'][k] = data['total'].get(k, 0) + v return data