![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2011
Device: SONY PRS-650
|
calibredb remove ...
Hi,
is there a way to delete alot of book at the same time from Calibre via the "calibredb remove" command? I will delete all books with tags:"x" or all book with series:"y". Something like this: Code:
calibredb list -s series:"xxx" | calibredb remove |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,581
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibredb remove -h
Usage: calibredb remove ids Remove the books identified by ids from the database. ids should be a comma separated list of id numbers (you can get id numbers by using the list command). For example, 23,34,57-85 |
![]() |
![]() |
![]() |
#3 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2011
Device: SONY PRS-650
|
Thanks but after an
Code:
calibredb remove 1223-1237 Code:
Traceback (most recent call last): File "site.py", line 58, in main File "site-packages/calibre/library/cli.py", line 1192, in main File "site-packages/calibre/library/cli.py", line 361, in command_remove ValueError: int() base must be >= 2 and <= 36 |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,581
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Typo, fixed in next release.
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2011
Device: SONY PRS-650
|
Thanks, waiting for next release.
|
![]() |
![]() |
![]() |
#6 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2011
Device: SONY PRS-650
|
Works better but the last book would be not remove from library.
Code:
calibredb remove 12-15 Thanks |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,581
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That's the way lists indices work in python. Use 12-16
|
![]() |
![]() |
![]() |
#8 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2025
Device: none
|
calibredb remove in batch process
Hi,
I am trying to do something like BerlinerKindle. The calibre program (8.10) runs on Windows 10 and the library and books are on my NAS. Everything works fine. I want to automate a cleaning process and run the calibredb commands in a batch file. I can find the required id's with calibredb search tags:"=YourTag" but don't know how I can pass the info to the calibredb remove-command. What doesn't work is calibredb search tags:"=YourTag" | calibredb remove Result: Another program such as calibre-server.exe or the calibre main program is open. Having multiple programs open that can make changes to a calibre library is a bad idea. calibredb can connect directly to an open calibre Content server to make changes there. See the --with-library option documentation for details. Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> OSError: [Errno 22] Invalid argument There is no other calibre program running, is stacking the two commands the problem? Trying to cut the action in two lines 1. calibredb search tags:"=YourTag" >>c:\temp\calibre_testing.txt 2. calibredb remove "c:\temp\calibre_testing.txt" doesn't work either Result: Traceback (most recent call last): File "runpy.py", line 198, in _run_module_as_main File "runpy.py", line 88, in _run_code File "site.py", line 83, in <module> File "site.py", line 78, in main File "site.py", line 50, in run_entry_point File "calibre\db\cli\main.py", line 253, in main File "calibre\db\cli\main.py", line 40, in run_cmd File "calibre\db\cli\cmd_remove.py", line 46, in main File "calibre\db\cli\__init__.py", line 14, in integers_from_string ValueError: invalid literal for int() with base 10: 'c:\\temp\\calibre_testing.txt' Can you tell me what I do wrong or is it simply not possible to do this in batch? |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,581
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
First pipe the output of your search into a variable. Then execute the remove command. Like this:
Code:
ids=$(calibredb search whatever) calibredb remove $ids |
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2025
Device: none
|
Thanks a million!
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
calibredb list | iomari | Calibre | 9 | 10-12-2011 11:30 AM |
calibredb list no subseries_index | reup | Library Management | 5 | 10-11-2011 10:32 AM |
calibredb | iomari | Calibre | 6 | 10-10-2011 08:35 AM |
calibredb strange behaviour | webwizard | Library Management | 9 | 04-17-2011 10:17 AM |
RFE: Remove remove tags in bulk edit | magphil | Calibre | 0 | 08-11-2009 10:37 AM |