From bf89140dad76eb57b5acc0c0391a9481098e0849 Mon Sep 17 00:00:00 2001 From: Roman Bazalevsky Date: Thu, 19 May 2016 22:47:24 +0300 Subject: [PATCH] =?utf8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD=D0=B0?= =?utf8?q?=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B0=20?= =?utf8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA,=20=D0=B2=20=D1=82.=D1=87.?= =?utf8?q?=20=D1=81=20=D0=B8=D0=B7=D0=B1=D1=8B=D1=82=D0=BE=D1=87=D0=BD?= =?utf8?q?=D0=BE=20=D0=B4=D0=BB=D0=B8=D0=BD=D0=BD=D1=8B=D0=BC=D0=B8=20?= =?utf8?q?=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8?= =?utf8?q?=D1=8F=D0=BC=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- fb2_process.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fb2_process.py b/fb2_process.py index 00ef213..595359a 100755 --- a/fb2_process.py +++ b/fb2_process.py @@ -66,9 +66,10 @@ class MetaData: author_ids = set() try: for author in self.authors: + print author.encode('utf-8') author_ids.add(db.GetOrCreateAuthor(author.encode('utf-8'))) except: - pass + pass except: self.author='Неизвестный Автор (%s)' % (tag) self.authors = [] @@ -117,7 +118,7 @@ class MetaData: ser_id=None try: self.series_idx = meta_dict['series_index'] - ser_num=meta_dict['series_index'] + ser_num=meta_dict['series_index'].split(',')[0] except: ser_num=None @@ -135,7 +136,10 @@ class MetaData: self.has_cover=0 try: - self.comments=meta_dict['comments'].encode('utf-8') + self.comments=meta_dict['comments'] + if len(self.comments)>20000: + self.comments=self.comments[:20000] + self.comments=self.comments.encode('utf-8') except: self.comments='' @@ -256,7 +260,7 @@ def CompressAll(limit=100): pass def CheckFiles(delete = 0): - ids = db.ListByFormat('FB2',300000) + ids = db.ListByFormat('FB2',1000000) cnt = 0 for id in ids: cnt = cnt + 1; @@ -267,7 +271,7 @@ def CheckFiles(delete = 0): if delete==1: db.DelBook(id) db.Commit() - ids = db.ListByFormat('FB2.ZIP',300000) + ids = db.ListByFormat('FB2.ZIP',1000000) cnt = 0 for id in ids: cnt = cnt + 1; -- 2.34.1