Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-08-2014, 01:12 PM   #1
usr
Junior Member
usr began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2014
Device: kindle and tablet
How Do I Refresh Calibre ID Numbers?

So, as part of the set-in-stone directory and file naming scheme (the reasoning for which, by the way, I don't buy) Calibre includes its "id number" at the end of the directories. If you have to remove a book, and later add more, the numbers continue to increase (leaving gaps).

How can I get Calibre to refresh these ids? It seems this functionality would be a basic element of library maintenance...no?

Thanks for the help!
usr is offline   Reply With Quote
Old 02-08-2014, 01:24 PM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
The id numbers are never re-used so it is normal to have gaps. The numbers actually relate to Id's internal to the database structure and it is typical of databases to never re-use them.

In normal use most users never worry about the Id values - is there some reason they concern you.
itimpi is offline   Reply With Quote
Advert
Old 02-08-2014, 01:37 PM   #3
unboggling
Wizard
unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.
 
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
Quote:
Originally Posted by usr View Post
How can I get Calibre to refresh these ids? It seems this functionality would be a basic element of library maintenance...no?
I don't worry about it. But to refresh all library-unique ID numbers, under library icon switch/create library, create an empty library at the new location with option checked to copy structure from current library. Switch back to old library. Select all books and Copy to Library into the new library. Voila, the new library's books are all ID numbered consecutively without gaps. Now remove the old library from calibre, then in the file system delete the old library's library folder.

But, as itimpi implied, why bother? You shouldn't be messing around inside the Library folder anyway. See: Want to change the folder structure of the Calibre library?, sticky by Manichean, spoiler content by Worldwalker.

Last edited by unboggling; 02-08-2014 at 01:46 PM.
unboggling is offline   Reply With Quote
Old 02-08-2014, 01:46 PM   #4
usr
Junior Member
usr began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2014
Device: kindle and tablet
Hmmm...I imagine it's a combination of me (at the moment) having to do a lot of combining the same book in multiple formats (I don't like converting, I like having the retails of whatever formats I can get) and the fact that I'm a bit OCD (so it's driving me crazy that the numbers would indicate I have thrice the number of books I actually have).

By the way, I know that's the purpose of the id numbers, but iterating over the books and adjusting the id numbers as part of database maintenance would in no way harm their functionality as ids. If anything, it would optimize it because some functions (I'm sure) would iterate over id numbers sequentially. So, for every id number without a corresponding entry Calibre would have to identify the situation and move to the next number.
usr is offline   Reply With Quote
Old 02-08-2014, 01:50 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,048
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Another voice:

{ID} is just for bookkeeping (ooo, a pun )

You may need ID if you are using the CLI. The CLI also has tools to return the ID from other CLI activities so there is little reason to actually be IN the folder.

You may want ID for device file (duplicate?) management

Calibre reports 2books on device, having {ID} at the end of the template may help.

As for Gaps, so what. This is not {Series_index}, where a gap means another book to buy
theducks is offline   Reply With Quote
Advert
Old 02-09-2014, 01:51 AM   #6
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by usr View Post
Hmmm...I imagine it's a combination of me (at the moment) having to do a lot of combining the same book in multiple formats (I don't like converting, I like having the retails of whatever formats I can get) and the fact that I'm a bit OCD (so it's driving me crazy that the numbers would indicate I have thrice the number of books I actually have).
It may be driving you crazy, but as indicated the numbers have no correlation to the total amount of books in your library and do not indicate you have any particular number of books. Obviously you have a need that I do not. In four years of using calibre the need to look at these numbers has never come up.

Quote:
Originally Posted by usr View Post
By the way, I know that's the purpose of the id numbers, but iterating over the books and adjusting the id numbers as part of database maintenance would in no way harm their functionality as ids.
Doing this very probably would cause books on the device to no longer match books in the library.

Quote:
Originally Posted by usr View Post
If anything, it would optimize it because some functions (I'm sure) would iterate over id numbers sequentially. So, for every id number without a corresponding entry Calibre would have to identify the situation and move to the next number.
I doubt there would be anything to gain since the numbers are simply unique identifiers and most likely treated as strings.

Last edited by DoctorOhh; 02-09-2014 at 01:53 AM.
DoctorOhh is offline   Reply With Quote
Old 02-09-2014, 07:35 AM   #7
LadyKate
Fanatic
LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.
 
Posts: 515
Karma: 1470724
Join Date: Jul 2013
Location: Quebec CA
Device: android 4 (samsung tablet and asus tablet)
Funny how the directory structure bugs almost every new user of Calibre.

For me it kept me from really "USING" Calibre as more than a conversion program.

Once you buy into the idea that Calibre is primarily a database that contains ebooks as part of it's record and that the directory structure is the database itself it becomes easier to ignore that directory entirely.

I tend to complete the quality checking and corrections of the books, title, author name, tags etc and then use modify epub to write the new metadata into the epub. To read the books I then do a save to disk to a library location (double checking the directories of dual author titles) and organize that directory to be copied to a micro sd to use on my tablet.

By doing this I can indulge my ocd about the library while leaving the "database" alone. As for it taking more disk space, well I just picked up a new 4TB usb drive for 160.00 cdn and you really need a backup or three of an important library to be safe.
LadyKate is offline   Reply With Quote
Old 02-09-2014, 11:58 AM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,048
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
If you want to KNOW how many books(titles) you have.
Look at the Status Line in the GUI.
This will even show the amount of the whole when using a VL
[2129 books, 1 selected, 4901 total]
theducks is offline   Reply With Quote
Old 02-09-2014, 04:09 PM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
- as well as the integer book id, I think calibre also assigns a UUID to each book, which is written as a ID in the opf that is embedded into EPUBs at least - you can see the value if you press 'I' on a book

Just out of curiosity what is it for?

BR
BetterRed is offline   Reply With Quote
Old 02-09-2014, 04:11 PM   #10
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by BetterRed View Post
- as well as the integer book id, I think calibre also assigns a UUID to each book, which is written as a ID in the opf that is embedded into EPUBs at least - you can see the value if you press 'I' on a book

Just out of curiosity what is it for?

BR
Matching books on your device, I believe.
eschwartz is offline   Reply With Quote
Old 02-09-2014, 04:34 PM   #11
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,628
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
I've looked at this thread because of a reason which is not related to OCD but future problems: which is the maximum id? If it's more that 2^32 or 2^64, I can forget it, I'll never reach it in my life. If it isn't, it can be a problem when the id reaches its limits.
Terisa de morgan is offline   Reply With Quote
Old 02-09-2014, 04:36 PM   #12
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
It will be at least 2^32, and may well be 2^64 - I cannot remember off-hand which it is.
itimpi is offline   Reply With Quote
Old 02-09-2014, 04:44 PM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by eschwartz View Post
Matching books on your device, I believe.
That's what I had sort of assumed until I saw the following from DoctorOhh in respect of 'resequencing' the id column in all the books (as suggested by this threads OP)

Quote:
Originally Posted by DoctorOhh View Post
Doing this very probably would cause books on the device to no longer match books in the library.
I cant recall under what circumstances, but an existing book can get a new value in its id column, but its UUID remains unchanged, thats what made me think the UUID was the synching link.

I only keep what I'm reading on my device so I don't use calibre synching. I copy other things to it with my file manager so why not copy books.

BR
BetterRed is offline   Reply With Quote
Old 02-09-2014, 04:46 PM   #14
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,628
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by itimpi View Post
It will be at least 2^32, and may well be 2^64 - I cannot remember off-hand which it is.
Thank you.
Terisa de morgan is offline   Reply With Quote
Old 02-09-2014, 04:54 PM   #15
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by itimpi View Post
It will be at least 2^32, and may well be 2^64 - I cannot remember off-hand which it is.
If calibre uses SQLite2 and book.id is an INTEGER PRIMARY KEY then I think its maximum value is 2,147,483,647 = see https://www.sqlite.org/datatypes.html

A 2 billion book calibre library - nuh, not in all our lifetimes laid end to end

BR
BetterRed is offline   Reply With Quote
Reply

Tags
id numbers, ids, refresh


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't Calibre preserve ISBN-10 numbers? MelBr Calibre 8 10-30-2013 11:22 AM
Calibre version numbers? Victoria Calibre 5 01-24-2012 04:42 PM
calibre now adds page numbers grizedale Amazon Kindle 38 06-20-2011 11:42 AM
Calibre Page Numbers soapy70 Devices 3 02-27-2011 03:15 PM
:OT: calibre numbers Dopedangel Calibre 2 01-03-2011 10:57 AM


All times are GMT -4. The time now is 05:17 PM.


MobileRead.com is a privately owned, operated and funded community.