|
|
#1 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 923
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Script to avoid downloading existing duplicates in calibre
Hi, I have a script to download books that checks if they exist in Calibre, but when I add them to Calibre, Calibre shows duplicates. What could I refine for that search? What I have stipulated is this:
Code:
# Search for exact matches in the calibre database
def find_identical_books(title):
try:
conn = sqlite3.connect(f"file:{CALIBRE_DB_PATH}?mode=ro", uri=True)
cursor = conn.cursor()
title = unicodedata.normalize("NFC", title).strip()
cursor.execute("SELECT id FROM books WHERE lower(title) = lower(?)", (title,))
result = cursor.fetchall()
conn.close()
return [r[0] for r in result] if result else []
except Exception as e:
log_message(f"⚠️ Error searching for duplicates in calibre: {e}")
return []
|
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 923
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Thank you, that's what I was missing.
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Downloading metadata: Comments adding to the existing text | ownedbycats | Calibre | 2 | 10-20-2021 12:49 PM |
| calibre, version 4.2.0 ERROR: No existing library found: There is no existing library | Alastair1646 | Library Management | 1 | 10-28-2019 10:26 AM |
| Duplicates handling with Find Duplicates plugin | erfjr | Calibre | 0 | 03-05-2013 03:52 PM |
| Script: store calibre ebooks as symlinks to existing lib; advanced CLI import | dancal | Calibre | 0 | 12-10-2012 08:09 PM |
| Calibre Duplicates | Starson17 | Calibre | 10 | 10-20-2010 01:06 PM |