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

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 10-07-2012, 07:05 AM   #1
Xwang
Member
Xwang began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Sep 2012
Device: none
Calibre in mixed case sensitive/insensitive environments

Hi to all!
I use calibre to manage my book collection on an usb disk formatted with ntfs.
I need to be able to operate calibre both in windows and linuxes environments.
So there are the possibility of issues due to the mixture of case sensitiveness and in sensitiveness and the possibility that adding a book under linux, the same is not accessible under windows due to its 256 character limit for the complete file path.
So, according to me, the best way to avoid such problems is:
1) assure that calibre creates directory and files all in upper case
2) assure that the overall length of the file path is no longer than a given value
(by opportunely shortening the file name or the name of the directory containing each book or both).
I'm not a very skilled python programmer (even if I've done some python programming some time ago) and I don't know how calibre is structured, however I would like to try to modify calibre so that to solve these incompatibility issues.
Before starting studying and coding, I would like to know if the proposed approach is feasible for the remaining part of the program or if it risks to break how the library is managed and in case I would like to discuss of alternative ways to solve the issue.
Finally if a solution will be found, will it be integrated in the main code?
Thank you,
Xwang
Xwang is offline   Reply With Quote
Old 10-07-2012, 07:07 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,154
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Why dont you simply use a case insensitive file system for linux? There are various FUSE based alternatives that will do the trick.
kovidgoyal is offline   Reply With Quote
Old 10-07-2012, 07:21 AM   #3
Xwang
Member
Xwang began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Sep 2012
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Why dont you simply use a case insensitive file system for linux? There are various FUSE based alternatives that will do the trick.
Do you mean ciopfs? Or which ever?
I did not known it, but I can verify if it resolves the first part of the problem.
The second one (the possibility to create under linux path longer than 256 characters) will remain unsolved (I've encountered such a problem having added a book under linux with a long name created by searching metadata on the net).
But this second issue seems to me more important than the previous one.
Xwang
Xwang is offline   Reply With Quote
Old 10-07-2012, 07:26 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,154
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It's a trivial (one line) patch to limit the filename length in calibre. It's not something I am going to accept into mainline calibre but instructions on running calibre from source are in the user manual, just follow them and make the change in your local copy.
kovidgoyal is offline   Reply With Quote
Old 10-07-2012, 07:50 AM   #5
Xwang
Member
Xwang began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Sep 2012
Device: none
Quote:
Originally Posted by kovidgoyal View Post
It's a trivial (one line) patch to limit the filename length in calibre. It's not something I am going to accept into mainline calibre but instructions on running calibre from source are in the user manual, just follow them and make the change in your local copy.
Ok! Thank you!
Xwang
Xwang is offline   Reply With Quote
Old 10-08-2012, 01:41 PM   #6
Xwang
Member
Xwang began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Sep 2012
Device: none
At the end I've decided to try to solve my problem by writing a plugin.
When called it will for each book in the library
1) rename all authors and book title by adding a "special" temporary string at the end
2) rename again authors and title by transforming in upper case and removing the special string
3) check if the path length from the Calibre library is excessively long and eventually rename the title by cutting the last part

This approach, if I'm correct, should:
a) avoid problems with the alternate use of linux and windows (at the cost of having all authors and titles displayed in upper case; cost which is not a matter to me)
b) permit me to avoid any modification to calibre source code (which then I will have to maintain for future releases)

Is this approach viable? Any suggestion?
Thank you,
Xwang

PS I've thought that to avoid unuseful renaming for books which have already been "upper cased", perhaps I can first off all compare the upper cased author name and title with the actual path on disk and proceed only if the two strings do not agree. If they agree I can directly pass to the following book.
Xwang is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change uppercase to mixed case ElMiko Sigil 15 06-13-2012 07:13 AM
Debug commands not case sensitive jmseight Kindle Developer's Corner 0 04-03-2012 11:11 PM
Case Sensitive Regular Expression silentguy Calibre 2 02-23-2012 04:27 PM
Small bug? Case-insensitive tags. Arrghus Calibre 9 07-12-2011 01:03 AM
K3 search case sensitive only? charonme Amazon Kindle 1 01-28-2011 05:15 PM


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


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