|  06-24-2012, 07:54 PM | #1 | 
| Junior Member  Posts: 8 Karma: 10 Join Date: Jun 2012 Device: Sony TS1 | 
				
				Help with replicating dir structure
			 
			
			Dear all, new at the forum... great work the SW and the community too! My question is the following. I use my Sony PRS T1 to read and to note a lot of PDF docs. So, I need these to be synced back to my laptop, where I keep my full bibliography. I do this via dropsync, but I would like to sync the Calibre biblio as it is, and to be able to manage the metadata via Calibre (titles, tags, etc). So: -if I sync my biblio as it is, and then I connect my device, Calibre is not able to recognize the presence of the documents on it as Calibre bibliotheque. - but if I first sent my Calibre biblio to the device (with the aim of keeping it synced later on), it would reproduce a dir structure which is not exactly that of Calibre. And therefore I will not be able to sync it. The solution is to play with the template, and to 'send to device' through a template that reproduces the Calibre dir structure. I've done several tries, but no success... Can anyone help me, by posting the template that reproduces exactly the Calibre internal dir structure? THanks! Max Last edited by maxpall; 06-26-2012 at 08:54 AM. Reason: Late night mistake in the name of my beloved reader... | 
|   |   | 
|  07-22-2012, 12:42 PM | #2 | ||
| Silicon Book Worm            Posts: 129 Karma: 27430 Join Date: Jul 2012 Location: England Device: Kobo Touch | Quote: 
 The specific naming issue I have is how to pass the number that gets appended to the folder when it's created. e.g. Let's say Fred adds "The Three Musketeers". calibre creates a folder "Alexandre Dumas\The Three Musketeers (103)\The Three Musketeers - Alexandre Dumas.epub". Whereas when I add it to my library, it creates "Alexandre Dumas\The Three Musketeers (41)\The Three Musketeers - Alexandre Dumas.epub". For Fred the number variable is 103, for me 41. The closest I've got so far following the calibre help is Quote: 
 | ||
|   |   | 
|  07-22-2012, 12:52 PM | #3 | |
| Well trained by Cats            Posts: 31,250 Karma: 61360164 Join Date: Aug 2009 Location: The Central Coast of California Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A | Quote: 
   | |
|   |   | 
|  07-22-2012, 01:17 PM | #4 | 
| Silicon Book Worm            Posts: 129 Karma: 27430 Join Date: Jul 2012 Location: England Device: Kobo Touch | 
			
			Believe it or not I had just sussed that out by reading "Preferences, Sending Books To Devices" and was coming back to post my findings when I see you pipped me to it.  But thanks very much   For Max & everyone else, the template to replicate calibre's library on your device is: {authors}/{title} ({id})/{title} - {authors} | 
|   |   | 
|  07-27-2012, 07:01 PM | #5 | 
| Junior Member  Posts: 8 Karma: 10 Join Date: Jun 2012 Device: Sony TS1 | 
			
			Shai-Hulud, thanks for the attempt but.... it doesn't work... I believe the problem is with complicated authors/titles. This book, in the PC is \Calibre\Dematteis G_\Il territorio nello sviluppo locale. Il (378)\Il territorio nello sviluppo locale. Il - Dematteis G_.pdf In the reader becomes \books\Dematteis G. & Governa F_\territorio nello sviluppo locale. Il contributo del modello SLoT, Il (378)\territorio nello sviluppo locale. Il contributo del modello SLoT, Il - Dematteis G. & Governa F_.pdf There are two issues: a long title becomes truncated, but it is not easy to find out the rule; and then only the first_author is used in the calibre original structure Anyone has a hint...?  Max | 
|   |   | 
|  07-27-2012, 07:27 PM | #6 | 
| Resident Curmudgeon            Posts: 80,746 Karma: 150249619 Join Date: Nov 2006 Location: Roslindale, Massachusetts Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 | 
			
			do away with the directory structure on the device as when you delete the eBooks, you are left with empty directories. Go to preferences and under Sending books to devices, put in {authors) - {title}. | 
|   |   | 
|  07-28-2012, 09:18 AM | #7 | |
| Silicon Book Worm            Posts: 129 Karma: 27430 Join Date: Jul 2012 Location: England Device: Kobo Touch | Quote: 
 I have tested the template I posted previously and it correctly builds the default calibre library folder/file structure on the root of a usb device when you use calibre to initiate the sync. e.g. [Author]\[Book Title] [ID]\[Book Title] - [Author].pdf The examples you have posted above ring alarm bells for me because neither adhere to the default "Calibre Library\Author\Book Name\Book Name - Author.pdf" structure used by calibre. I suspect that from a combination of using dropsync, direct copying to calibre and a misconfigured Sony plug-in, your calibre library is no longer wholly in the standard format which is why the template doesn't work for you. So do you try to correct it manually or start again from scratch? Obviously I can't decide for you since it depends on personal factors such as available time and library size. All I can offer is how I would set up calibre to ensure a consistent result: 1. Choose your canonical source of PDFs (I strongly suggest your calibre library) and make all future changes with respect to that. 2. Assuming you have a clean install of calibre and have freshly re-imported your PDFs, edit the metadata for each book paying careful attention that the author and book title values are in the correct order and that the sort values match them. 3. Edit your device plugin (Preferences\Plug-ins\Device Interface Plug-ins\Sony PRST1 and newer) and replace the template with the one I suggested. I would also suggest unticking the "author sort for author" option and "Use Sony Author format". 4. Having previously reset (or cleared all books from) your Sony, try a test sync for one book from calibre to your Sony. Hopefully the file/folder structure will now match your calibre library. Alternatively, consider if you really need to adhere to calibre's folder/file structure. If not, follow JSWolf's advice and keep it simple. Good luck. | |
|   |   | 
|  07-28-2012, 12:18 PM | #8 | |
| Resident Curmudgeon            Posts: 80,746 Karma: 150249619 Join Date: Nov 2006 Location: Roslindale, Massachusetts Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 | Quote: 
 So if you want to risk cluttering up your reader with lots of empty directories, feel free to create them. But you don't really need them. | |
|   |   | 
|  07-28-2012, 04:37 PM | #9 | 
| Silicon Book Worm            Posts: 129 Karma: 27430 Join Date: Jul 2012 Location: England Device: Kobo Touch | 
			
			Well I can't speak for Max but in my case I do (if you read my previous posts).  It's a trade off for getting the bulk of the calibre library onto my KT then using calibre to manage them seamlessly.
		 | 
|   |   | 
|  08-01-2012, 05:50 AM | #10 | 
| Zealot      Posts: 109 Karma: 419 Join Date: Aug 2012 Location: Spain Device: Kindle Touch | 
			
			You can try using this template to replicate Calibre's folder structure: program: strcat(sublist(field('author'),0,1,'&'), '/', substr(raw_field('title'),0,40), ' (', field('id'), ')','/', substr(raw_field('title'),0,40), ' - ', sublist(field('author'),0,1,'&')) | 
|   |   | 
|  08-01-2012, 06:48 AM | #11 | ||
| Silicon Book Worm            Posts: 129 Karma: 27430 Join Date: Jul 2012 Location: England Device: Kobo Touch | Quote: 
 Quote: 
 | ||
|   |   | 
|  08-01-2012, 07:50 AM | #12 | ||
| Zealot      Posts: 109 Karma: 419 Join Date: Aug 2012 Location: Spain Device: Kindle Touch | Quote: 
 1.- If the book has more than one author, {auhors} puts all them. In Calibre's folders, only the first author is used. 2.- If the title is too long, in Calibre's folders only first 40 characters are used. {title} uses all them. 3.- Also, {title} uses save_template_title_series_sorting variable to set the title's sorting. Calibre's folders use always strictrly alphabetic order. And when I tried the template, and I put save_template_title_series_sorting = 'strictrly_alphabetic', Calibre ignores it, and continues using library_order (a bug?). For example, a book titled "The long way" form "Peter Jones & Carl Black": Using the template {authors}/{title} ({id})/{title} - {authors}, the directory structure is: Peter Jones & Carl Black/long way, The (xxx)/long way, The - Peter Jones & Carl Black And using the template 'program', the result is: Peter Jones/The long way (xxx)/The long way - Peter Jones And this is the same directory structure Calibre uses for internal book storage (the question MaxPall asks in first post) Quote: 
 Last edited by Pepin33; 08-01-2012 at 07:56 AM. | ||
|   |   | 
|  08-05-2012, 10:05 AM | #13 | |
| Silicon Book Worm            Posts: 129 Karma: 27430 Join Date: Jul 2012 Location: England Device: Kobo Touch | Quote: 
 Thanks Pepin for your explanation and template - it does indeed replicate the calibre library structure (which is what both Maxpall and I wanted). Cheers   | |
|   |   | 
|  09-01-2012, 06:17 PM | #14 | 
| Junior Member  Posts: 8 Karma: 10 Join Date: Jun 2012 Device: Sony TS1 | 
			
			Sorry for very late reply: I was out of town for sometimes, and wanted to test the solution proposed before answering. Thanks, Pepin, for the code you posted. It works fine, a part of some issues (so far), concerning the substr of 40 chr from the title: First case: In case the last of the 40 characters is a ' ' (empty space), it is cut in the generation of the subdir, and also the title of the file. EXAMPLE: the following directory is for Calibre internal structure "After 2015_ progress and challenges for[two spaces](215)" but it is exported to device as "After 2015_ progress and challenges for (215)" Second case: if the book's title has a two subsequent empty spaces, it is reduced to one in exporting EXAMPLE: the following directory is for Calibre internal structure "After 2015 -[two spaces]Contexts, politics and pro (225)" but it is exported to device as "After 2015 - Contexts, politics and pro (225)" Third case: ? In this third case I0m not able to understand: an underscore at the place of an empty space EXAMPLE: the following directory is for Calibre internal structure "Post-2015 policymaking What is being pl (222)" but it is exported to device as "Post-2015 policymaking_What is being pla (222)" Thanks again! Max Last edited by maxpall; 09-01-2012 at 06:21 PM. | 
|   |   | 
|  09-02-2012, 02:45 PM | #15 | |
| Resident Curmudgeon            Posts: 80,746 Karma: 150249619 Join Date: Nov 2006 Location: Roslindale, Massachusetts Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 | Quote: 
 Code: {title} - {authors} | |
|   |   | 
|  | 
| Thread Tools | Search this Thread | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| [old thread] filename and library structure /author and titel structure | tscamera | Library Management | 4 | 05-31-2011 05:44 PM | 
| Lost.Dir | musicman2523 | PocketBook | 2 | 03-20-2011 11:29 AM | 
| Updates and LOST.DIR contents | drv | Nook Color & Nook Tablet | 2 | 01-28-2011 06:13 PM | 
| Kaufst Du Dir einen Kindle? | Alexander Turcic | Amazon Kindle | 223 | 06-01-2010 05:49 AM | 
| Copyright issues in replicating you library in eBook format | ZacWolf | News | 34 | 11-29-2009 04:51 PM |