| 
 | |||||||
|  | 
|  | Thread Tools | Search this Thread | 
|  06-02-2015, 12:47 PM | #16 | |
| Addict            Posts: 295 Karma: 2139988 Join Date: Nov 2014 Device: bookeen | Quote: 
 When I put the full file name , it adds as a duplicate so it works. But the thing is that I did not set these file names my self, Calibre truncated the file names on the file system and the converted djvu are named after whatever pdfs there were in the Calibre database folders. This would have been a perfect solution for me since I have not done any Python coding for years ;( Last edited by loviedovie; 06-02-2015 at 12:49 PM. | |
|   |   | 
|  06-02-2015, 04:43 PM | #17 | 
| null operator (he/him)            Posts: 22,010 Karma: 30277294 Join Date: Mar 2012 Location: Sydney Australia Device: none | 
			
			@loviedovie - calibre munges the book title and author names to accommodate the vagaries of the different operating/file systems it supports.  The shortening is done to fit names into Windows 255 (ish) path length limit. IIRC the loss of diacritics and 'conversion' of non latin characters (Greek, Cyrillic etc) to ASCII is done in order to maintain compatibility with some Linux file systems.   You could try something along these lines 
 BR | 
|   |   | 
|  06-02-2015, 05:35 PM | #18 | 
| Addict            Posts: 295 Karma: 2139988 Join Date: Nov 2014 Device: bookeen | 
			
			@BetterRed Thanks for the recommendations. I will give it a try. | 
|   |   | 
|  06-02-2015, 05:44 PM | #19 | |
| null operator (he/him)            Posts: 22,010 Karma: 30277294 Join Date: Mar 2012 Location: Sydney Australia Device: none | Quote: 
  BR | |
|   |   | 
|  06-02-2015, 07:20 PM | #20 | 
| Addict            Posts: 295 Karma: 2139988 Join Date: Nov 2014 Device: bookeen | 
			
			Thanks for the tip.  What should I use for the saving template? "{title}-{authors}" ? | 
|   |   | 
|  06-02-2015, 07:51 PM | #21 | 
| Addict            Posts: 295 Karma: 2139988 Join Date: Nov 2014 Device: bookeen | 
			
			Ok this does not work me either ;( Actual book title:Greek Vases in the J. Paul Getty Museum, Volume 3, OPA 2 auth:János Gy. Szilágy saved pdf: "Greek_Vases_in_the_J._Paul_Getty_Museum,_Volume_3 ,_OPA_2-@-Janos_Gy._Szilagy.pdf" converted djvu: "Greek_Vases_in_the_J._Paul_Getty_Museum,_Volume_3 ,_OPA_2-@-Janos_Gy._Szilagy.djvu" save format: "{title}-@-{authors}" add books regex: "(?P<title>.+)-@-(?P<author>[^_]+)" This is tested properly with the regex in the add books window meaning that all the underscores are repalced with spaces properly and the author is recognized properly. I wonder if the new template which replaces spaces with underscores is the issue? | 
|   |   | 
|  06-02-2015, 09:42 PM | #22 | |
| null operator (he/him)            Posts: 22,010 Karma: 30277294 Join Date: Mar 2012 Location: Sydney Australia Device: none | Quote: 
 I created a book with that name and author - good choice btw. The PDF in the book folder is Code: Greek Vases in the J. Paul Gett - Janos Gy. Szilagy.pdf And I got this as the saved file name Code: Greek Vases in the J. Paul Getty Museum, Volume 3, OPA 2 - János Gy. Szilágy.pdf When I added a DOCX with the name Code: Greek Vases in the J. Paul Getty Museum, Volume 3, OPA 2 - János Gy. Szilágy.doc And in the book folder I have Code: Greek Vases in the J. Paul Gett - Janos Gy. Szilagy.doc Greek Vases in the J. Paul Gett - Janos Gy. Szilagy.pdf  BR | |
|   |   | 
|  06-02-2015, 10:38 PM | #23 | 
| Addict            Posts: 295 Karma: 2139988 Join Date: Nov 2014 Device: bookeen | 
			
			@BetterRed Thanks for all your help, this works for me  Great way to achieve what I needed. This should be a wiki entry  This is my script to convert to djvu. It can be run in a folder. It is linux only and you need pdf2djvu package #!/bin/bash fltyp() { IFS=$'\n' filename_full="$1" filename=$(basename "$filename_full" .pdf) export DIR=$(readlink -f $filename_full) DIR=${DIR%/*} echo $DIR pdf2djvu -j 4 --lossy -v "$2" -o $DIR/$filename.djvu } export -f fltyp find -type f -name "*.pdf" -exec bash -c 'fltyp "{}" "{}"' \; | 
|   |   | 
|  06-02-2015, 11:45 PM | #24 | |
| null operator (he/him)            Posts: 22,010 Karma: 30277294 Join Date: Mar 2012 Location: Sydney Australia Device: none | Quote: 
  glad we got there, sorry it took so long.  My fault, I didn't pay enough attention to the regex, I forgot the tweak, and the unset of ascii-fication setting in Save  BR | |
|   |   | 
|  06-03-2015, 06:09 PM | #25 | |
| Addict            Posts: 295 Karma: 2139988 Join Date: Nov 2014 Device: bookeen | Quote: 
 @BetterRed, You did great help. I was able to add all the Djvus with minor hickups. Hopefully in the future Calibre could detect these additional formats and add them automatically and also it could provide to Djvu conversion as well. | |
|   |   | 
|  06-04-2015, 02:07 AM | #26 | 
| creator of calibre            Posts: 45,604 Karma: 28548974 Join Date: Oct 2006 Location: Mumbai, India Device: Various | 
			
			If all you want to do is get calibre to recognize djvu files in the library folders that are named exactly the same as the PDF files, you can do that by running Library Maintenance and adding the detected extra formats.
		 | 
|   |   | 
|  06-04-2015, 11:44 AM | #27 | |
| Addict            Posts: 295 Karma: 2139988 Join Date: Nov 2014 Device: bookeen | Quote: 
 I actually tried that as the first method but it did not work. It showed the additional formats but there was no way to select anything to "fix". No checkbox if I remember correctly. Last edited by loviedovie; 06-04-2015 at 01:43 PM. | |
|   |   | 
|  06-16-2015, 10:29 PM | #28 | 
| Ex-Helpdesk Junkie            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) | 
			
			... And back to the topic of parsing json in bash, it's pretty much impossible -- unless you use a tool like jshon. Obviously a proper programming language like python will be easier to work with -- but if you really want to do it with bash you can.   I have used jshon before, for parsing calibredb's output. | 
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Manually tweak date (& time?) added? | Snorkledorf | Library Management | 1 | 04-09-2014 09:37 AM | 
| Manually add a TOC entry | p3aul | Sigil | 4 | 06-13-2012 08:22 AM | 
| Manually adding different formats of a book | murali | Calibre | 4 | 12-02-2010 02:17 PM | 
| Force Calibre not to add Page Breaks on H1 and H2 Tags | jloakes | Calibre | 2 | 11-18-2010 04:08 PM | 
| How can I add multiple formats (without converting) and have Calibre see them? | strannik | Calibre | 4 | 02-03-2010 05:49 PM |