06-24-2018, 10:55 AM | #1 |
Chalut o/
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
[Feature suggest] Maintenance option: Reindexed the library
First one, a trivial question:
What is the theoretical limit of the library index? I guess that's an unattainable number, but I'm curious The thread question: Would it be possible to make an option of maintenance of the library which allows to re-index the books and to fill the possible voids in the numbering? So, Yes, I know this is a very delicate operation. The user interface must ther be frozen to prevent any library modification during the process. But as the operation can be very long, it would be necessary to leave a button "Stop reindexing". Once this button is clicked, Calibre finishes the current book then release the user control. _____________ Currently, when a book is added, Calibre gives it "last index+1". It is a simple solution, fast and without headache. I'm nothing against it, and it would be monstrously and unnecessarily complicated to test the free indexes when adding a book (and slowed Calibre) But, a separate maintenance option, why not. |
06-24-2018, 11:11 AM | #2 |
Grand Sorcerer
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
As somebody who comes from the software world, unless you reach the limit of the index (maximum number allowed by the size of the field), it doesn't make sense for me
|
06-24-2018, 11:11 AM | #3 |
Deviser
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
Good joke. Very funny. It makes me smile. Have a nice day.
|
06-24-2018, 11:32 AM | #4 |
Chalut o/
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
|
06-24-2018, 12:52 PM | #5 |
Grand Sorcerer
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
|
06-24-2018, 03:05 PM | #6 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
The procedure is: (not tested...)
Save all your books to disk, making sure to save covers and complete updated metadata in opf:s. Create a new empty calibre library, with the same structure as the old. Import all the saved books to the new library, reading metadata from OPF:s. Enjoy lovely low index numbers without gaps. For a while... Test first on a small representative subset of books... It is essentially a database dump and restore from dump. I remember when that was the usual way to speed up and compact databases... |
06-24-2018, 03:28 PM | #7 | |
Well trained by Cats
Posts: 29,804
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
OTOH Doing the Copy To Library gives the book a new assignment (and is not susceptible to orphans) as part of the task. If the destination starte empty, they will be sequential |
|
06-24-2018, 06:23 PM | #8 |
null operator (he/him)
Posts: 20,572
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@un_pogaz - why do you care?
BR |
06-24-2018, 09:53 PM | #9 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There's never going to be such a feature. book ids are meant to be stable, they are for instance, used in content server urls. You can of course do it yourself by using various tricks such as copy to library to a new library, but I strongly recommend against it.
|
06-25-2018, 04:07 AM | #10 |
Chalut o/
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
@BetterRed Why not ? More precisely, I see my library growing more and more, I am not worried, but just curious.
@Adoby Nope,I don't recommend this method. The best is what Kovid suggests: Move your library in a another via Calibre. Use "Save to disk" would be doubly longer (writing then adding) and uncertain. @kovidgoyal Yes, it is an easy solution that has the merit of already being implemented. However, it has a flaw: The "Move books" function copies all books and deletes all books only if the operation ends normally. If the operation is interrupted, even via the button designed for, the books already copied are not deleted from the source library. Result, duplicates between the 2 libraries. A mass move (Select all > Move to library) is such an enormous risk that it makes it impossible. So you stay in front of Calibre and move your library, 100 by 100 (for exemple), manually. One solution would be to copy the books and delete them 1 by 1, gradually. This might be slower than the current method, but it would be a true "Move to library" function. I leave you to judge this change. Thank for answer Last edited by un_pogaz; 06-25-2018 at 11:16 AM. |
06-25-2018, 05:04 AM | #11 |
null operator (he/him)
Posts: 20,572
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@un_pogaz - why renumber the Books table, and not the other tables with auto incremented primary keys, viz:
This may be of interest ==>> Implementation Limits For SQLite. BR |
06-25-2018, 11:05 AM | #12 | |
Chalut o/
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
From the page Implementation Limits For SQLite
Quote:
Hum I think we can rest easy. |
|
06-25-2018, 12:03 PM | #13 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Killer Feature I suggest | desk7 | Onyx Boox | 9 | 07-07-2017 02:17 AM |
Missing Library/Library Maintenance button | babyshelley | Library Management | 2 | 06-20-2015 01:05 PM |
Library Maintenance option missing? | xterminal | Library Management | 3 | 08-27-2012 03:48 PM |
Library Maintenance feature removed? | Trickery | Library Management | 1 | 03-04-2011 02:14 PM |