self.sort_title = db.SortName(self.title).replace(' ','_');
self.sort_author = db.SortAuthorName(self.author).replace(' ','_');
self.path = ("%s/%s/%s/%s/%s (%d)" % (self.sort_author[0],self.sort_author[0:2],self.sort_author[0:4],self.sort_author[0:32],self.sort_title[0:64],self.book_id))
- self.dataname = (self.title.decode('utf-8')[0:64]+' '+self.author.decode('utf-8')[0:32]).replace('/','')
+ self.dataname = (self.title.decode('utf-8')[0:64]+' -- '+self.author.decode('utf-8')[0:32]).replace('/','')
def __init__(self,meta_dict,size):
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)