Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 01-20-2011, 04:19 PM   #46
Jankomatic
Junior Member
Jankomatic began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle
I was running it with the --rb, but not --nc . It seems my problem is end user related though. I did not see that mornington had posted another version of the script further down the first page. I was using the script in the zip file form the first post. Thanks for taking a look at it though and I would greatly appreciate the bat files you are using to rebuilt and update.

Thanks again.
Jankomatic is offline   Reply With Quote
Old 01-20-2011, 04:21 PM   #47
CWatkinsNash
IOC Chief Archivist
CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.
 
CWatkinsNash's Avatar
 
Posts: 3,407
Karma: 30739026
Join Date: Dec 2010
Location: Nashville, TN, USA
Device: Nook STR Glowlight, Sony T1, Acer Iconia A200
Quote:
Originally Posted by Jankomatic View Post
I was running it with the --rb, but not --nc . It seems my problem is end user related though. I did not see that mornington had posted another version of the script further down the first page. I was using the script in the zip file form the first post. Thanks for taking a look at it though and I would greatly appreciate the bat files you are using to rebuilt and update.

Thanks again.
I'm using the first version too - I had the same prob with the second verision and didn't want to use the various "miscellany" collection options in the second version. I'll grab those bat files and post them in a few moments.
CWatkinsNash is online now   Reply With Quote
Old 01-20-2011, 04:39 PM   #48
CWatkinsNash
IOC Chief Archivist
CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.
 
CWatkinsNash's Avatar
 
Posts: 3,407
Karma: 30739026
Join Date: Dec 2010
Location: Nashville, TN, USA
Device: Nook STR Glowlight, Sony T1, Acer Iconia A200
Quote:
Originally Posted by CWatkinsNash View Post
I'm using the first version too - I had the same prob with the second verision and didn't want to use the various "miscellany" collection options in the second version. I'll grab those bat files and post them in a few moments.
As promised, here are the bat files. Just open them in notepad to change them as needed. You can also remove the option to automatically open the log at the end if you want.

They go in the Kindle root with the collections script. Makes things superfast and painless. I just use Calibre to add books, close Calibre, open the Kindle root in Explorer, double click the bat file, wait for it to run then eject and restart.
Attached Files
File Type: bat Rebuild Kindle Collections.bat (399 Bytes, 118 views)
File Type: bat Update Kindle Collections.bat (394 Bytes, 106 views)
CWatkinsNash is online now   Reply With Quote
Old 01-26-2011, 07:16 AM   #49
petersem
Junior Member
petersem began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2011
Device: Kindle
Need help to understand collections.Json file

I understand that file references in the kindle's collections.json file are SHA1 hashes of the full filename and path.

I have figured out how to write some .net code to replicate these hashes as a first step to writing my own kindle book collection utility.

here's the code:

Public Shared Function GetHash(ByVal fileName As String) As String
'[TODO] ** Files with an _ in them do not encode the same as on the kindle! WHY??

Dim bytes As Byte() = Encoding.UTF8.GetBytes(fileName)
Using hashAlg As HashAlgorithm = New SHA1Managed
hashAlg.TransformFinalBlock(bytes, 0, bytes.Length)
Return String.Format("*{0}", BitConverter.ToString(hashAlg.Hash).Replace("-", String.Empty).ToLower)
End Using
End Function


What i DO NOT UNDERSTAND is that if one of the books has an underscore '_' in the filename, then i get different hash using the above function than what is generated by the Kindle. For all other files, the hash is the same.

Why are underscores treated differently and are there any other special characters that are similar to underscores? How do adapt my code to manage this?

thanks in advance

Matt
petersem is offline   Reply With Quote
Old 01-26-2011, 08:21 PM   #50
petersem
Junior Member
petersem began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2011
Device: Kindle
Quote:
Originally Posted by mornington View Post
I've attached a slightly modified version of the script.

These changes should make it a bit friendlier if you have a lot of azw files, or other files with embedded metadata, and/or some "unusual" characters in author names, series, tags or book titles.

What are the unusual charaters and how do you fix these? can you point me to where this is done in the script please?
petersem is offline   Reply With Quote
Old 01-26-2011, 09:33 PM   #51
CWatkinsNash
IOC Chief Archivist
CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.CWatkinsNash ought to be getting tired of karma fortunes by now.
 
CWatkinsNash's Avatar
 
Posts: 3,407
Karma: 30739026
Join Date: Dec 2010
Location: Nashville, TN, USA
Device: Nook STR Glowlight, Sony T1, Acer Iconia A200
Quote:
Originally Posted by petersem View Post
What are the unusual charaters and how do you fix these? can you point me to where this is done in the script please?
Mornington is no longer supporting the script because he no longer has a Kindle with which to test it. That said, from what I remember, this version of the script changes the handling of certain unicode characters - instead of screeching to a halt, the script will throw an error and try to continue with the rest of the books. I don't believe it specifies which ones, it just has an error provision for characters it is unable to handle.

I wish I could be more help, but I use a slightly modified version of the first script. I looked at this second one but I couldn't find anything more specific than what I've already stated. I know enough about the script to get it to do what I need it to, but not enough to provide much in the way of support. I know very little Python.

If you're still trying to work out the underscore issue with your .net script or need more help with this Python script, you might want to try the Kindle Developer's sub-forum here at MobileRead. It can be found inside the Kindle forum at the top (right above the stickies).
CWatkinsNash is online now   Reply With Quote
Old 01-27-2011, 05:31 AM   #52
peegee
Enthusiast
peegee will become famous soon enoughpeegee will become famous soon enoughpeegee will become famous soon enoughpeegee will become famous soon enoughpeegee will become famous soon enoughpeegee will become famous soon enough
 
Posts: 27
Karma: 574
Join Date: Nov 2010
Device: kindle
I just want to express my thanks to mornington for this script. A great idea and it works a treat!
peegee is offline   Reply With Quote
Old 01-27-2011, 07:01 AM   #53
petersem
Junior Member
petersem began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2011
Device: Kindle
Quote:
Originally Posted by CWatkinsNash View Post
Mornington is no longer supporting the script because he no longer has a Kindle with which to test it. That said, from what I remember, this version of the script changes the handling of certain unicode characters - instead of screeching to a halt, the script will throw an error and try to continue with the rest of the books. I don't believe it specifies which ones, it just has an error provision for characters it is unable to handle.

I wish I could be more help, but I use a slightly modified version of the first script. I looked at this second one but I couldn't find anything more specific than what I've already stated. I know enough about the script to get it to do what I need it to, but not enough to provide much in the way of support. I know very little Python.

If you're still trying to work out the underscore issue with your .net script or need more help with this Python script, you might want to try the Kindle Developer's sub-forum here at MobileRead. It can be found inside the Kindle forum at the top (right above the stickies).
Thanks dude
petersem is offline   Reply With Quote
Old 01-27-2011, 11:55 AM   #54
romandesign
Member
romandesign began at the beginning.
 
romandesign's Avatar
 
Posts: 13
Karma: 10
Join Date: Jan 2011
Location: Toronto
Device: Kindle 3
Thanks for a great script. Seems to work OK. I just need collections by author, so I removed all the "miscellany" and others auto-collections code. It's easy to remove it. I have many of those ASCII errors (have 100+ russian books), but the actual books seem to be fine, added into collections etc. Out of 500+ books I have two or three that seem to be stuck and not added to collections, and Lewis Carril's Alise gets added to its own collection every time, despite it's just one book (other lonely books do not get their collections as I intended). I will post if I can resolve this.

-------
Roman Bershadsky
Web designer, Roman Design Toronto web design studio
romandesign is offline   Reply With Quote
Old 01-27-2011, 01:15 PM   #55
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
I've just posted a new Create Kindle Collections plugin for Calibre at
http://www.mobileread.com/forums/sho...d.php?t=118635

Its still new, but if you want to try it, feel free to head over to the link, download it and post comments in that thread.

I started it after reading this thread and seeing that development had stopped. I've taken a slightly different approach in that I ignore the existing collections on the Kindle since I just want to use Calibre as the source data so it might not be for everyone.
meme is offline   Reply With Quote
Old 01-27-2011, 04:12 PM   #56
romandesign
Member
romandesign began at the beginning.
 
romandesign's Avatar
 
Posts: 13
Karma: 10
Join Date: Jan 2011
Location: Toronto
Device: Kindle 3
This is amazing, I wonder why anybody didn't do it before. I'm going to check it out and see if it works. Thanks for the effort!
romandesign is offline   Reply With Quote
Old 01-27-2011, 04:18 PM   #57
romandesign
Member
romandesign began at the beginning.
 
romandesign's Avatar
 
Posts: 13
Karma: 10
Join Date: Jan 2011
Location: Toronto
Device: Kindle 3
Just reporting, a follow-up on my script test: same three books are left our, and same book has put in a collection alone. Out of 500+ books that's not bad, I easily reassign those books in Kindle in a couple of minutes.
romandesign is offline   Reply With Quote
Old 11-26-2013, 04:53 PM   #58
Analoggab
Member
Analoggab began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Dec 2011
Device: Sony T1
Since the Calibre collections plugin doesn't work on the Kindle PW1-2, would that first technique of mornington work? (configurable python script)

Trying desperately to find a way to manage collections within calibre
Analoggab is offline   Reply With Quote
Old 11-26-2013, 08:00 PM   #59
eschwartz
Irrational Optimist
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.
 
Posts: 4,433
Karma: 5751844
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch (Wifi only)
Quote:
Originally Posted by Analoggab View Post
Since the Calibre collections plugin doesn't work on the Kindle PW1-2, would that first technique of mornington work? (configurable python script)

Trying desperately to find a way to manage collections within calibre
No, the problem is the collections.json which the kindle reads collections from is located in the system memory starting with the Kindle Touch generation.

However, if you jailbreak your Kindle, the collections manager plugin can set collections for the Kindle Touch/PW/PW2.
eschwartz is offline   Reply With Quote
Reply

Tags
calibre, collections, kindle, kindle 3

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-300 creating collections terraskye Sony Reader 4 11-28-2010 10:01 AM
Collections data format in 2.5 firmware ngukho Kindle Developer's Corner 18 10-29-2010 11:19 PM
Backing Up Data (Collections) Cpl Punishment Amazon Kindle 14 10-27-2010 01:41 PM
Calibre and creating Kindle collections on the PC? guiyoforward Calibre 1 07-30-2010 02:11 AM
Creating collections within collections larlissm Sony Reader 2 10-04-2008 08:02 PM


All times are GMT -4. The time now is 04:14 PM.


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