MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=237)
-   -   Plugin to fix fb2 files (https://www.mobileread.com/forums/showthread.php?t=204081)

oviksna 01-28-2013 06:43 AM

Plugin to fix fb2 files
 
Hello,

I wanted to use Calibre to manage books un FB2 format. Problem is that these books specify singe character encoding (windows-1251) in xml header, but uses lots of numeric (for example Ł) character encoding. Those characters are not displayed properly by my reader, so I wanted to convert fb2 books to UTF-8 encoding. To automate this process I created simple plugin for FB2 format, that checks if FB2 file needs conversion to UTF-8 and performs it when needed.

Problem. When importing FB2 file everything works OK. When importing zipped FB2 files, this plugin is not called, so conversion is not performed.

Question. How to write plugin for zipped FB2 files? Maybe this is bug in Calibre?

Thanks

kovidgoyal 01-28-2013 06:56 AM

Write a plugin for zip files. calibre already has a builtin plugin for zip files, you will need to disable that to get it to use your plugin.

oviksna 01-28-2013 07:54 AM

Can I see source of existing zip plugin? Tried to search Calibre source, but cannot find anything zip-related, only how resources are extracted from plugin zips.

Idea. In my opinion better idea would be to perform some plugin chaining, when output from one plugin could be processed by another. As zip is not a book, but container, why not process output by "normal" book plugins?

kovidgoyal 01-28-2013 09:53 AM

metadata/archive.py


All times are GMT -4. The time now is 08:29 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.