X-Git-Url: https://git.rvb.name/openlib.git/blobdiff_plain/169adb0ddaf8cc3eedfa15b500e14570bda0cdee..39d3000402d5c9419868be3cbd93b9093e5bf8a5:/fb2_process.py?ds=inline diff --git a/fb2_process.py b/fb2_process.py index 38d8876..d8c01c1 100755 --- a/fb2_process.py +++ b/fb2_process.py @@ -279,7 +279,21 @@ def CheckFiles(delete = 0): db.DelBook(id) db.Commit() +def RemoveDups(limit = 100): + if limit<2: + return + id_to_del=set([]) + recs = db.ListDups(limit); + for rec in recs: + ids = db.ListByTitleAndAuthor(rec[0],rec[1],rec[2]) + for id in ids: + id_to_del.add(id) + for id in id_to_del: + print "\r Deleting %s..." % (id) + DelBook(id) + def main(): + print "Processing...\r" ProcessDir(db.tmp_files) CompressAll(2000)