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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-04-2012, 11:51 PM   #1
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
author-title metadata and file name

Hi there,

I'm a complete newbie. My question may have been answered in the past, in which case please forgive me and please point me to the url.

I have the latest calibre. I'm only using its viewer at present, but have begun experimenting with metadata.

I have a bunch of epubs and mobis downloaded from various sources like amazon, guttenberg, archive.org, and so on. They come with different manners of metadata and convention for file names. I'd like to adopt my own convention for the whole lot.

I want:

The file NAME to be "Author - Title - Language.epub" or "Author - Title - Language.mobi", e.g. "Joannot Martorell - Tirant lo blanc - Catalan.mobi" and "Joannot Martorell - Tirant lo blanc - Espanol.epub" AND the metadata to be consistent with the file name.

Currently Calibre does the opposite: title first, author second. Now I did see the much-advertised option to swap the title and the author, and that does indeed give me the correct file name, but then calibre displays Joannot Martorell as "title" and "Tirant lo blanc" as "author", which is wrong.

It's a little weird because Calibre itself orders things in folders sorted by author names, so somehow recognizes that sorting by author names is the way to go, but then does not apply this logic to the naming of the file.

Note that at present I am getting "Title - Author.mobi" and the "language" I am adding into the title itself on a case by case basis. But of course I'd really like to automate the process, with calibre reading the "language" and adding it to the file name after author and title.

I don't mind having long file names, I don't want them to be cropped, is there a way to extend the maximum number of characters allowed for a file name?

Also, as an extra (easier) question, how can I clear a "field"? For instance, I'd like to remove all ratings and all genres for all my files. I'm able to assign the same rating to all the files, but for some reason couldn't work out how to clear for all.

many thanks!
annoporci is offline   Reply With Quote
Old 11-05-2012, 01:11 AM   #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,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
You cannot affect the way that Calibre stores its files internally in its library (you should treat that as if it was a 'black box' and not try and mess with it). See this sticky for more on this.

You can control the folder/filename format used when Calibre exports books from the library by setting the "save to disk" template.
itimpi is offline   Reply With Quote
Old 11-06-2012, 12:58 PM   #3
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
thanks itimpi,

The reason I went into the library is that I'm using calibre to convert epub to mobi and that's where the .mobi files were stored.

I'll never go there again.

I did "save to disk" instead, and interestingly the folder hierarchy came out differently with a "title" folder inside a "surname, name" folder, but the file names remained unchanged as "title - name+surname.mobi".

Are you saying I can change the format of that name when I use "save to disk"?

How do I change the "file name" format for files I "save to disk" ?

Many thanks for your help.

And would you know how I can remove all ratings from all books?

Thanks again.
annoporci is offline   Reply With Quote
Old 11-06-2012, 01:21 PM   #4
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,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by annoporci View Post
Are you saying I can change the format of that name when I use "save to disk"?

How do I change the "file name" format for files I "save to disk" ?
.
Under Preferences->Saving to Disk you can set the Save Template.

If you are using the "Send to Device" options then each output device plugin can be individually customized with its own save_template for that device.
itimpi is offline   Reply With Quote
Old 11-06-2012, 03:03 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: 29,754
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Saving or Sending have preferences for setting preferred format order
theducks is offline   Reply With Quote
Old 11-07-2012, 08:25 AM   #6
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
thanks to both of you, itimpi and theducks, I'm getting closer.

I've managed to swap the author and title fields in the file after I "save to disk" by selecting the following template:

{authors}/{authors} - {title}

So that's pretty intuitive once you've worked out where to look. Thanks a lot for your help.

It seems there's no way to batch-convert the authors format from "Twain, Mark" to "Mark Twain", correct me if I'm wrong.

I also wanted to add language to the file name.

Based on what I read there: http://manual.calibre-ebook.com/temp...codes-localize, I tried:

{authors}/{authors} - {title} - {language_strings(lang_codes, localize)}

Based on intuition, I also tried:

{authors}/{authors} - {title} - {language}

Neither works. Does anyone know how to do it? Many thanks.
annoporci is offline   Reply With Quote
Old 11-07-2012, 10:27 AM   #7
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: 29,754
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by annoporci View Post
thanks to both of you, itimpi and theducks, I'm getting closer.

I've managed to swap the author and title fields in the file after I "save to disk" by selecting the following template:

{authors}/{authors} - {title}

So that's pretty intuitive once you've worked out where to look. Thanks a lot for your help.

It seems there's no way to batch-convert the authors format from "Twain, Mark" to "Mark Twain", correct me if I'm wrong.

I also wanted to add language to the file name.

Based on what I read there: http://manual.calibre-ebook.com/temp...codes-localize, I tried:

{authors}/{authors} - {title} - {language_strings(lang_codes, localize)}

Based on intuition, I also tried:

{authors}/{authors} - {title} - {languages}

Neither works. Does anyone know how to do it? Many thanks.
Use the Quality check plugin to swap Author names.:
First run the metadata check: find Authors with Commas
Select all the results (de-select those you do not want to change)
Then run the:
Fix: Swap Author....
theducks is offline   Reply With Quote
Old 11-07-2012, 12:32 PM   #8
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,728
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by annoporci View Post
I also wanted to add language to the file name.

Based on what I read there: http://manual.calibre-ebook.com/temp...codes-localize, I tried:

{authors}/{authors} - {title} - {language_strings(lang_codes, localize)}

Based on intuition, I also tried:

{authors}/{authors} - {title} - {language}
In single function mode use
Code:
{authors}/{authors} - {title} - {language:language_strings(1)}
In template program mode use
Code:
{authors}/{authors} - {title} - {0:'language_strings(field('languages'), 1)'}
chaley is offline   Reply With Quote
Old 11-07-2012, 01:58 PM   #9
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
Quality Check Plugin

Quote:
Originally Posted by theducks View Post
Use the Quality check plugin to swap Author names.:
First run the metadata check: find Authors with Commas
Select all the results (de-select those you do not want to change)
Then run the:
Fix: Swap Author....
Fantastic advice theducks, I would never have worked that one out by myself.

The plugin is very easy to use. It has a huge amount of possibilities. Using it and some labor time, I've been able to clean up the different fields I find useful (title, author, language, Publisher [why isn't there a "translator" field and a "other authors" field (for preface, introduction, etc.)? an oversight!]). I've been able to fix the author names.

I discovered that amazon is not consistent in naming, for instance, none other than... Cervantes, who is at times Miguel de Cervantes, at other times Miguel de Cervantes Saavedra, at times Miguel Cervantes (of course he was all of these and more).

I'm still having a minor issue with the format of the titles, e.g. I get:
"A. A. Milne - Red House Mystery, The.azw"
when I'd rather have:
"A. A. Milne - The Red House Mystery.azw"

I haven't yet worked out how to not get the article "The" tagged at the end. The book title is the way I want inside calibre, but it is changed when saving to disk. This is my template: {authors}/{authors} - {title}.

I tried both "language" and "languages" and neither worked. Ah but I notice a new post by chaley on the topic.

Bottom line theducks

P.S. While all my authors are listed alphabetically by the first name, e.g. John Stuart Mill is listed below "I" and before "K", the author A.A.Milne whom you'd expect to sit right at the top instead is immediately below John Stuart Mill, so the double A is ignored by calibre. Anyway, not to worry, it doesn't bother me, just a comment in passing.
annoporci is offline   Reply With Quote
Old 11-07-2012, 02:03 PM   #10
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
Quote:
Originally Posted by chaley View Post
In single function mode use
Code:
{authors}/{authors} - {title} - {language:language_strings(1)}
In template program mode use
Code:
{authors}/{authors} - {title} - {0:'language_strings(field('languages'), 1)'}
Thanks chaley!

This one worked in the Preferences -> Saving books to disks -> Template Editor:

{authors}/{authors} - {title} - {0:'language_strings(field('languages'), 1)'}

annoporci is offline   Reply With Quote
Old 11-07-2012, 02:16 PM   #11
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: 29,754
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by annoporci View Post
Fantastic advice theducks, I would never have worked that one out by myself.

The plugin is very easy to use. It has a huge amount of possibilities. Using it and some labor time, I've been able to clean up the different fields I find useful (title, author, language, Publisher [why isn't there a "translator" field and a "other authors" field (for preface, introduction, etc.)? an oversight!]). I've been able to fix the author names.

I discovered that amazon is not consistent in naming, for instance, none other than... Cervantes, who is at times Miguel de Cervantes, at other times Miguel de Cervantes Saavedra, at times Miguel Cervantes (of course he was all of these and more).

I'm still having a minor issue with the format of the titles, e.g. I get:
"A. A. Milne - Red House Mystery, The.azw"
when I'd rather have:
"A. A. Milne - The Red House Mystery.azw"

I haven't yet worked out how to not get the article "The" tagged at the end. The book title is the way I want inside calibre, but it is changed when saving to disk. This is my template: {authors}/{authors} - {title}.

I tried both "language" and "languages" and neither worked. Ah but I notice a new post by chaley on the topic.

Bottom line theducks

P.S. While all my authors are listed alphabetically by the first name, e.g. John Stuart Mill is listed below "I" and before "K", the author A.A.Milne whom you'd expect to sit right at the top instead is immediately below John Stuart Mill, so the double A is ignored by calibre. Anyway, not to worry, it doesn't bother me, just a comment in passing.
use QC to find author sort problems, the fix the AS in the editor

Sort is a Preference: Tweaks
You don't want 'Library order' (2 places)
theducks is offline   Reply With Quote
Old 11-08-2012, 03:19 AM   #12
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
Quote:
Originally Posted by theducks View Post
Sort is a Preference: Tweaks
You don't want 'Library order' (2 places)
Got it, that can be controled in two places:
1. "Control sorting of titles and series in the Library display"
2. "Control formatting of titles and series when used in templates"

"Control how title and series names are formatted when saving to disk/sending
to device. The behavior depends on the field being processed. If processing
title, then if this tweak is set to 'library_order', the title will be
replaced with title_sort. If it is set to 'strictly_alphabetic', then the
title will not be changed. "

Changed it and it worked.
annoporci is offline   Reply With Quote
Old 11-08-2012, 03:57 AM   #13
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
I found an alternative way of tagging books by language. I used the "tags" field to set the language in the abbreviated form: en, es, fr, ca, la, ... for English, Spanish, French, Catalan, Latin, etc. And then I append this to the template - {tags} and it gives me:

Johanot Martorell - Tirant Lo Blanc - ca
Johanot Martorell - Tirant Lo Blanc - es
Johanot Martorell - Tirant Lo Blanc - en

It's shorter and I like it better to have ca than to have Catalan.

Thanks to all of you for your help!

Now I really wish there were a "translator" field, because I have multiple translations of this book. (Cervantes praised it as the best ever, in case you're curious about the Tirant to blanc obsession running through this thread)

EDIT: I found out that you can add your own column, e.g. translator, illustrator, other_authors, etc.. Great!

Last edited by annoporci; 11-08-2012 at 04:08 AM. Reason: add info
annoporci is offline   Reply With Quote
Old 11-08-2012, 04:08 AM   #14
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,728
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by annoporci View Post
I found an alternative way of tagging books by language. I used the "tags" field to set the language in the abbreviated form: en, es, fr, ca, la, ... for English, Spanish, French, Catalan, Latin, etc. And then I append this to the template - {tags} and it gives me:

Johanot Martorell - Tirant Lo Blanc - ca
Johanot Martorell - Tirant Lo Blanc - es
Johanot Martorell - Tirant Lo Blanc - en

It's shorter and I like it better to have ca or catala than to have Catalan.
You could get very close to the same thing with
Code:
{authors}/{authors} - {title} - {language}
Using tags for that is rather dangerous because tags are used for all sorts of things. If you want to maintain it yourself, you should use a custom column, probably "text with a fixed set of values".
chaley is offline   Reply With Quote
Old 11-08-2012, 01:53 PM   #15
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
Quote:
Originally Posted by chaley View Post
You could get very close to the same thing with
Code:
{authors}/{authors} - {title} - {language}
Using tags for that is rather dangerous because tags are used for all sorts of things. If you want to maintain it yourself, you should use a custom column, probably "text with a fixed set of values".
thanks Chaley,

well I refrained from redefining language from, say, Spanish to es, because I wasn't sure if Kindle would then recognize the correct language and pop the appropriate dictionary.

I should, as you say, have created a custom column instead of hijacking the tags. However, I don't use the tags at all ("romance", "poetry" ... yes I know, they're my books! on the other hand I do need a quick way to identify books with the same title but different languages).

I see that you can clear certain fields (like the tags) for a batch of books, but I haven't found how to do that for the ratings.

cheers for now, thanks again for your help.
annoporci is offline   Reply With Quote
Reply

Tags
author, title

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't change title metadata of .mobi file? dkgonda Library Management 1 03-04-2012 06:20 PM
Metadata is changing my Title/author upon exit. Gros'Land Library Management 2 06-04-2011 09:34 AM
Title and author's Metadata is switched Student1 Library Management 8 01-23-2011 10:35 PM
Recognition of author and title from html files/reading metadata from a seperate file Lethe Calibre 5 04-03-2010 08:35 AM
when importing file title metadata screwed up dschiri1 Calibre 1 07-25-2009 11:24 AM


All times are GMT -4. The time now is 04:56 AM.


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