![]() |
#1 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Jan 2017
Device: none
|
ebook-files not recognized after conversion by calibr-server
I run a calibre-server on my Debian-7-NAS.
Database+ebooks are stored in /media/xxx/calibre. I use EPUB as prefered format, but want to provide MOBI as well. So i converted all EPUBs with command-line to MOBI, set permissions correct (same as the epub, 750), restarted server-instance, but the server does not offer the MOBI in Web-GUI. Code:
#!/bin/bash IFS=$'\n' for file in `find /media/xxx/calibre/ -type f -name "*.epub"` do /opt/calibre/ebook-convert "$file" "${file%epub}mobi" && chown calibre:users "${file%epub}mobi" done I think I have to add the file-format to DB with Code:
calibredb add_format --dont-replace id ebook_file Do I need to specify the location of DB separately? Last edited by riff; 01-03-2017 at 07:59 AM. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,079
Karma: 14079267
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
Because you mucked about under Calibre's skirts. Ebook-convert does just that: it converts an ebook file from one ebook format to another. It does not update Calibre's database (metadata.db)
i.e. Calibre has no idea the MOBI files exist, even though they are physically there. If you run 'Check database' and have it compare the database with the files on disk, it will show the MOBI files as extra files. I'm not sure you then get the option to 'adopt' them, as it were; I don't think so, actually. You do get the option to delete them, that I know. If you want to do this, do the conversion from the GUI. edit: Or start messing about with the other command line tools, as you yourself suggest :-) Last edited by mbovenka; 01-03-2017 at 08:06 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Jan 2017
Device: none
|
for
Code:
./calibredb check_library Code:
No library found at None Code:
./calibredb --library-path /media/xxx/calibre/metadata.db check_library I am not that advanced in using bash and command line. I did connect with GUI to the server (Remote-DB), but is crap converting the ebooks like that, because they will be downloaded, converted and uploaded again. I work a lot far away from home, so my goal was that the server can work on conversion itself. Using GUI from remote just takes sooo long an blocks my laptop meanwhile. On lost VPN-Connection, conversion is stopped with an error. Edit: Code:
./calibredb --with-library=/media/xxx/calibre/ check_library Edit: I tried Code:
./calibredb --with-library=/media/xxx/calibre/ add_format book-id /media/xxx/calibre/author/book-title/book-title.mobi Edit: Code:
./calibredb add_format --with-library=/media/xxx/calibre/ book-id /media/xxx/calibre/author/book-title/book-title.mobi Edit: Script now looks like this: Code:
#!/bin/bash IFS=$'\n' for file in `find /media/xxx/calibre/ -type f -name "*.epub"` do /opt/calibre/ebook-convert "$file" "${file%epub}mobi" && chown calibre:users "${file%epub}mobi" idstring=`dirname "${file%epub}mobi"` idstring=${idstring%\)} /opt/calibre/calibredb add_format --with-library=/media/xxx/calibre/ ${idstring##*\(} "${file%epub}mobi" done Edit 23.02.2017 I added a check for existing MOBI-Files in my script Code:
#!/bin/bash IFS=$'\n' for file in `find /media/xxx/calibre/ -type f -name "*.epub"` do if [ ! -f "${file%epub}mobi" ] then /opt/calibre/ebook-convert "$file" "${file%epub}mobi" && chown calibre:users "${file%epub}mobi" idstring=`dirname "${file%epub}mobi"` idstring=${idstring%\)} /opt/calibre/calibredb add_format --with-library=/media/xxx/calibre/ ${idstring##*\(} "${file%epub}mobi" fi done When I apply the script to my large DB it works out well in beginning, but messes things up after a while. When my source EPUB file is for example "Albert Einstein - My Biography.epub" a file with name "Albert Einstein - My Biography.mobi" should be created and added to the DB. But somehow in between I get two MOBI Files in one book directory, the "Albert Einstein - My Biography.mobi" and another one like "Einstein, Albert - My Biography (French).mobi" My DB does not contain any MOBI at the beginning, so I can exclude the fact the "creepy file" existed before. Only a couple books get two MOBIs, I can't tell why. Also I can't figure out where these files come from and have a different name than the script would generate. This is quite annoying, because it messes up my DB and I have to restore a backup. How can I figure out what is wrong and how can I solve my problem? I appreciate your help, thank you in advance. Last edited by riff; 02-23-2017 at 03:45 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
GnuTLS: received alert [112]: The server name sent was not recognized | exachillus | Calibre | 4 | 03-26-2014 08:29 AM |
Calibr: options d'affichage (paramétrer) | icare2 | Software | 3 | 02-11-2014 10:10 PM |
Would this work for Calibr Server? | Synergi | Library Management | 12 | 10-07-2013 07:48 PM |
calibre-server: Doesn't server up newly added files | kaistian | Calibre | 5 | 03-17-2013 11:54 AM |
ebook-convert not recognized as a command | p3aul | Calibre | 11 | 10-11-2009 03:19 PM |