![]() |
#16 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,327
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
PR pushed
@kjdavies: Once the above PR is accepted (it is accepted), and once it is released if you are not running from source, this script merges metadata from N books into one. EDIT: merge_book_metadata() was moved to become a db new_api method. I changed the script. Code:
from calibre.db.legacy import LibraryDatabase if not LibraryDatabase.exists_at(sys.argv[1]): print(f'no such library or not a library: {sys.argv[1]}') exit() db = LibraryDatabase(sys.argv[1]) ids = sys.argv[2:] if len(ids) < 2: print('must supply at least 2 ids') ids = [int(i) for i in ids] dest_id = ids[0] ids = ids[1:] db.new_api.merge_book_metadata(dest_id, ids) Code:
calibre-debug -e path-to-script path-to-library book_id book_id [book_id *] Last edited by chaley; 10-02-2023 at 06:30 AM. Reason: merge_book_metadata became a db api method |
![]() |
![]() |
![]() |
#17 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 112
Karma: 53342
Join Date: Jun 2013
Device: Sony PRS-600
|
Quote:
|
|
![]() |
![]() |
![]() |
#18 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 112
Karma: 53342
Join Date: Jun 2013
Device: Sony PRS-600
|
@chaley, I just downloaded and installed 6.28 (Windows 10).
I tried to merge two titles via the GUI and I get an error message: Code:
calibre, version 6.28.0 ERROR: Unhandled exception: <b>AttributeError</b>:'tuple' object has no attribute 'extend' calibre 6.28 embedded-python: True Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19045') Python 3.10.1 Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Action Chains (1, 18, 12) && Babelio_db (0, 8, 3) && Baen (1, 1, 0) && Barnes & Noble (1, 5, 2) && CalibreSpy (1, 0, 92) && Category Tags (0, 2, 8) && Comicvine (0, 14, 1) && Consolidate All Library Metadata (2, 0, 46) && Count Pages (1, 13, 2) && Embed Comic Metadata (1, 6, 6) && Entities Manager (1, 0, 19) && Extract ISBN (1, 6, 0) && FanFicFare (4, 28, 0) && Fantastic Fiction (1, 6, 4) && Fantastic Fiction Adults (1, 3, 0) && FictionDB (1, 4, 1) && Find Duplicates (1, 10, 8) && Generate Cover (2, 3, 3) && Goodreads (1, 7, 9) && Highlights to Obsidian (1, 4, 0) && Job Spy (1, 0, 239) && Manage Series (1, 5, 1) && Mass Search-Replace (1, 7, 4) && Open With (1, 8, 1) && Quality Check (1, 13, 6) && Reading List (1, 15, 1) && Recipe Reader (1, 0, 1) && Smashwords Metadata (1, 0, 2) && View Manager (1, 10, 2) && all recipes Recipe Reader (1, 0, 2) Traceback (most recent call last): File "calibre\gui2\actions\edit_metadata.py", line 676, in merge_books File "calibre\gui2\actions\edit_metadata.py", line 734, in merge_metadata File "calibre\db\cache.py", line 85, in call_func_with_lock File "calibre\db\cache.py", line 3260, in merge_book_metadata AttributeError: 'tuple' object has no attribute 'extend' |
![]() |
![]() |
![]() |
#19 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,327
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
It is fixed in source. |
|
![]() |
![]() |
![]() |
#20 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 112
Karma: 53342
Join Date: Jun 2013
Device: Sony PRS-600
|
Quote:
Does it still integrate the tags (resulting in the union of the two sets)? |
|
![]() |
![]() |
![]() |
#21 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,327
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
EDIT: Merging stops at the error, which means that if there are multiple source books then all metadata for some books might not be merged into the destination. Last edited by chaley; 10-06-2023 at 12:58 PM. |
|
![]() |
![]() |
![]() |
#22 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 112
Karma: 53342
Join Date: Jun 2013
Device: Sony PRS-600
|
Quote:
That is, if TitleA has tag1, tag2, tag3, and TitleB has tag2, tag3, tag4, then after the merge I'm left with TitleA with title and author and cover of the original TitleA[1] and tag1, tag2, tag3, tag4. [1] unless null -- if author is Unknown or there is no cover in TitleA, but TitleB has author or cover, the resulting TitleA will pick them up from the TitleB entry. IOW, if merge still has the same behavior but different access, we're all good. |
|
![]() |
![]() |
![]() |
#23 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,171
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes, th ebehavior has not changed.
|
![]() |
![]() |
![]() |
#24 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,327
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#25 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,327
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The regression is fixed in calibre release 6.28.1.
|
![]() |
![]() |
![]() |
#26 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 112
Karma: 53342
Join Date: Jun 2013
Device: Sony PRS-600
|
Quote:
Thanks for confirming, @chaley and @kovidgoyal. |
|
![]() |
![]() |
![]() |
#27 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,592
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
|
![]() |
![]() |
![]() |
#28 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 112
Karma: 53342
Join Date: Jun 2013
Device: Sony PRS-600
|
|
![]() |
![]() |
![]() |
Tags |
calibredb, merge |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Installer for calibredb only? | Freakeao | Calibre | 3 | 12-09-2020 09:19 PM |
Merge books, how to select FIRST book or MERGE metadata? | rboatright | Library Management | 11 | 08-20-2016 11:01 AM |
commandline calibredb | Divingduck | Calibre | 2 | 07-31-2014 05:18 AM |
calibredb | iomari | Calibre | 6 | 10-10-2011 08:35 AM |
Merge feature request (different merge) | Tarran | Calibre | 1 | 05-24-2010 10:57 AM |