Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-14-2010, 12:52 AM   #1
jchrist
Junior Member
jchrist began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Feb 2010
Device: kindle
rename files based on metadata

Hi there,

I recently imported a large number of titles into my library which had really
crappy filenames *and* metadata. I spent a good deal of time cleaning up the metadata, so now my metadata is perfect. However, the calibre directory structure still reflects the original filenames and authors. For instance,
I have a directory named "Arthur C. Clarke" and one called "Arthur Charles Clark". Further, the filenames within those directories have not really been cleaned up either.

I understand that calibre's directory structure is its own. However, is there a command/option to re-structure the directory tree based on the current metadata? I ask because when I connect to iTunes and export the files the old, messy, incorrect filenames show up in the iTunes "name" field, even though the files have perfectly good metadata.

Thanks,
Jon
jchrist is offline   Reply With Quote
Old 09-14-2010, 01:19 AM   #2
jchrist
Junior Member
jchrist began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Feb 2010
Device: kindle
Quote:
Originally Posted by jchrist View Post
Hi there,
I have a directory named "Arthur C. Clarke" and one called "Arthur Charles Clark". Further, the filenames within those directories have not really been cleaned up either.
Apologies, it seems that I had missed something when editing the metadata. I was able to consolidate the directory names by changing the author field in the metadata.

However, the *filename* is still bogus. Is there any way to get calibre to change the filename to the metadata title so that it shows up with a reasonable name in iTunes?

Thanks,
Jon
jchrist is offline   Reply With Quote
Advert
Old 09-14-2010, 01:30 AM   #3
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by jchrist View Post
Hi there,

I recently imported a large number of titles into my library which had really
crappy filenames *and* metadata. I spent a good deal of time cleaning up the metadata, so now my metadata is perfect. However, the calibre directory structure still reflects the original filenames and authors. For instance,
I have a directory named "Arthur C. Clarke" and one called "Arthur Charles Clark". Further, the filenames within those directories have not really been cleaned up either.
Generally each time you change the metadata, the directory structure is automatically self correcting. Any mislabeled directories are either a fluke or you still have that entry in your library and it is sorting wrong. To take a closer look at the authors in your library go to the tag browser hover over authors, right click on manage authors. This window will show you all your authors and author_sort values.

I just went through my entire directory structure and found three directories that seemed wrong. They still had a book in them and when I went to check calibre's library it turns out that each of these authors I had made a typo. Once I changed the name in calibre, the directory was automatically changed too.

Did these garbage directories have calibre's ID at the end of each book directory under the author's directory (see attached).

Did you initially point calibre to a directory to use for its library that already had stuff/books in it? If you did that explains all of the junk lying around. calibre never messes with source documents.

I've been told that if a directory had third party entries in it like thumbnails or search info then calibre can't change the directory just create a new one.

Does any of the above ring a bell?

I have 985 authors and 4000+ books and I haven't looked at my directory structure in a year and the only thing I found out of place were 3 typos I had entered in the metadata. Once these typos were corrected all of the suspect directories went away and the books were moved to their proper place.

Good Luck, let us know what you discover.
Attached Thumbnails
Click image for larger version

Name:	calibre_id.jpg
Views:	1880
Size:	102.0 KB
ID:	58171  
DoctorOhh is offline   Reply With Quote
Old 09-14-2010, 01:39 AM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by jchrist View Post
Apologies, it seems that I had missed something when editing the metadata. I was able to consolidate the directory names by changing the author field in the metadata.
I'm glad you sorted that out.

Quote:
Originally Posted by jchrist View Post
However, the *filename* is still bogus. Is there any way to get calibre to change the filename to the metadata title so that it shows up with a reasonable name in iTunes?
I don't use iTunes for books but the file name in the directory structure has nothing to do with the file name that is sent to iTunes. I believe the Save template under Send to Device tab in the import/export section of preferences controls this name.

Did you try Connecting to iTunes yet?
DoctorOhh is offline   Reply With Quote
Old 09-14-2010, 01:53 AM   #5
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 3,450
Karma: 10484861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by jchrist View Post
However, the *filename* is still bogus. Is there any way to get calibre to change the filename to the metadata title so that it shows up with a reasonable name in iTunes?
Use function "Save files to disk" from inside Calibre.
In preferences, you can set how the name is supposed to look. Like
{authors}/{series} {series_number} - {title}

You can either leave the names inside the Calibre directory as they are and only use "Save files to disk" function, or you can use "Save files to disk" and then delete the books from inside Calibre and import them from this saved directory.
kacir is offline   Reply With Quote
Advert
Old 09-14-2010, 01:59 AM   #6
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by kacir View Post
You can either leave the names inside the Calibre directory as they are and only use "Save files to disk" function, or you can use "Save files to disk" and then delete the books from inside Calibre and import them from this saved directory.
Maybe you can help me understand, doesn't the Connect to iTunes feature use the save template I referred to and automatically adjust the file names as it sends the books to iTunes? Why take the step of sending the books elsewhere first?

I admit I don't use iTunes so i am ignorant of the details but I thought I understood the basic theory of how calibre interacts with iTunes using the Connect to iTunes feature.
DoctorOhh is offline   Reply With Quote
Old 09-14-2010, 03:42 AM   #7
jchrist
Junior Member
jchrist began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Feb 2010
Device: kindle
Quote:
Originally Posted by dwanthny View Post
Maybe you can help me understand, doesn't the Connect to iTunes feature use the save template I referred to and automatically adjust the file names as it sends the books to iTunes?
Apparently not. That setting, for me, is the default:
{author_sort}/{title} - {authors}

However, I have (for instance) a book whose metadata contains:
Author: Frank Herbert
Title: Chapterhouse: Dune

However, it shows up in iTunes' "name" column/field as:
Dune Book 6 Chapterhouse: Dune

The iTunes "Album" field is "Chapterhouse: Dune".

The file name is:
Chapterhouse_ Dune - Frank Herbert.epub

So, how can I get both "Name" and "Album" in iTunes to be the "title" field from calibre?
jchrist is offline   Reply With Quote
Old 09-14-2010, 03:51 AM   #8
jchrist
Junior Member
jchrist began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Feb 2010
Device: kindle
Quote:
Originally Posted by jchrist View Post
Dune Book 6 Chapterhouse: Dune
This, by the way, matches the original name of the file when I imported it into calibre, before I cleaned up the metadata:

Dune Book 6 Chapterhouse_ Dune - Frank Herbert.epub

Why won't this old, ugly name go away? How/why is calibre sending this to iTunes as the "Name" property?
jchrist is offline   Reply With Quote
Old 09-14-2010, 04:07 AM   #9
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by jchrist View Post
This, by the way, matches the original name of the file when I imported it into calibre, before I cleaned up the metadata:

Dune Book 6 Chapterhouse_ Dune - Frank Herbert.epub

Why won't this old, ugly name go away? How/why is calibre sending this to iTunes as the "Name" property?
I can't answer this question. Go to this thread and read the first post. Follow what it says and if you have any questions ask them in that thread. The developer for the Connect to iTunes feature will respond to questions there.
DoctorOhh is offline   Reply With Quote
Old 09-14-2010, 05:23 AM   #10
Coleccionista
Connoisseur
Coleccionista began at the beginning.
 
Posts: 67
Karma: 40
Join Date: Aug 2010
Device: iPad, Kindle Paperwhite
Have you checked that your ePUB does not already contain an iTunesMetadata.plist file?

iTunes will grab title/name/sorting from the metadata in the OPF , which should be right if you set it up in calibre, unless the ePUB in question already has a specific iTunes metadata file

If no iTunesMetadata.plist is present saving the book to disk from calibre or using the "connect to iTunes" should give you the same basic fields for title/author/cover and author_sort
Coleccionista is offline   Reply With Quote
Old 09-14-2010, 10:28 AM   #11
jchrist
Junior Member
jchrist began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Feb 2010
Device: kindle
Quote:
Originally Posted by Coleccionista View Post
Have you checked that your ePUB does not already contain an iTunesMetadata.plist file?

iTunes will grab title/name/sorting from the metadata in the OPF , which should be right if you set it up in calibre, unless the ePUB in question already has a specific iTunes metadata file

If no iTunesMetadata.plist is present saving the book to disk from calibre or using the "connect to iTunes" should give you the same basic fields for title/author/cover and author_sort
Hey, that seems to be the culprit. There *is* an iTunesMetadata.plist file in this specific epub.

So...what's the best way to get rid of these .plist files for an entire library? I unzipped this specific epub to check, using the mac command line, but that's not tractable for hundreds of files. Is there a calibre setting to override the iTunesMetadata file?

Thanks,
Jon
jchrist is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating TOC for books based on Text Files crich70 Kindle Formats 4 09-13-2010 12:47 AM
Language metadata in ePub files HarryT Calibre 24 07-19-2010 10:24 PM
how to export metadata and rename files? argonaut Calibre 11 06-24-2010 08:30 AM
Quick metadata from ePUB files Jellby ePub 0 02-14-2010 06:11 AM
How do you rename files on the reader? RWJ Sony Reader 3 07-25-2008 10:58 AM


All times are GMT -4. The time now is 09:37 AM.


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