Jump to content

CalibBrowser - Multi-faceted viewer for calibre


TheSaint
 Share

Recommended Posts

Only early days at this point, but I have been pondering such a program for a while.

As good as calibre is (thank you Kovid Goyal), which is a great and wonderful ebook suite of tools and a fair database, it does have its limitations. One of which, is how it deals with multiple libraries, another is the views you get. CalibBrowser will seek to address those.

What CalibBrowser is not going to be, is an editor for existing calibre libraries. That will be left up to calibre, which is very much needed still, and covers many aspects I will never look at. Unlike calibre, which is quite a complex program, CalibBrowser also seeks to be simple. It is mainly a viewer, at this point, but will later be able to create its own libraries. However, it does not and will not export them to calibre, especially as calibre employs a far different method and structure to what CalibBrowser will employ.

When CalibBrowser starts, it looks for calibre executables and the main Calibre Library. Whatever isn't found, you get prompted for with a browse option.

A calibre library, is a set of ebook folders (Author\Ebooks) and a database file, always named metadata.db, and which causes an issue when it comes to multiple libraries, but makes life a bit easier when reconstructing any corrupted libraries. However, there are better ways to deal with that, as my program will show.

The metadata.db file is an SQL database, so I am having a learning curve right now, as I have only ever dealt with an SQL database previously, codewise, when I created my INItoSQL program some time last year, as an exercise to prove a point.

At the moment, things are pretty basic, and not everything works 100%. Here is a screenshot, to give an idea of it, but keep in mind, I intend to expand the current GUI for other stuff I will be adding.

CalibBrowser_series.PNG.5f635dbfd7760c059388d5348443cd51.PNG

Older Screenshots

Spoiler

CalibBrowser_full.PNG.91fe18a533d40a38b3579c3812e1032f.PNG

CalibBrowser.PNG.b55da3add13dca1f028eacda138c84fe.PNG

Gawd, I just noticed the '3|7' in the Book Input field (original screenshot). I was using that during troubleshooting for the multiple images scrolling and forgot to disable it ... not that it impacts anything. When it comes to maths, I struggle a bit, especially when tired. Right scrolling was easy, with a continuous loop, was easy to implement. Left scrolling was significantly harder for my poor brain ... until I realized I needed to see them as Min and Max.

As you can see the program is usable, and all the buttons, aside from the Program Information one, work. You can even load different calibre libraries, and even reload after making changes to one with calibre. The calibre program does not need to be running, even to view an ebook in the Calibre Reader. The combo selector for a library and the ADD button are only temporarily placed where they are, until I expand the GUI.

My intention at this point, is to add another five thumbnail images, directly below existing. Currently they aren't clickable, but I may add that.

Here is another screenshot, of what you see when you click the larger Cover image.

CalibBrowser_Prev.PNG.52f3366a74e4d5a4bc9d482feb328359.PNG

If you want to have a play with the program as is, then you will need to also get the 'sqlite3.dll' file from some online source. When CalibBrowser starts successfully with the selected calibre library, it copies its metadata.db file to a sub-folder of the program called 'Backups'. It also creates a sub-folder in that, based on the library name, to house it. That copied file, is the one the program uses, though it does not even edit that, and file modification is checked every time the program starts with a particular library, or when you Reload or select a library. If the original source file has been modified, then the program copy is overwritten. The Reload Database button does nothing, if there is no change detected, and reports such.

Place the required 'sqlite3.dll' file in the CalibBrowser root folder. Download includes source files (sqlite3.dll excepted).

Also required of course, is an install of calibre, plus some ebooks in a created library - Calibre Library is the default when you first add ebooks to calibre. The Mobile Read Forums, is a great source for all things ebook, and calibre can be found there in the E-Book Software section.

Quote

WARNING - If you decide to modify my code for your own method or approach, then I advise strongly, that you don't work directly with an original calibre metadata.db file, but instead use a copied version. As I and others have found out, calibre does not like to share. As I discovered, if calibre is running, and accessing a library, that you also start accessing, then if you close calibre before your program, calibre will report a violation error and crash ... even if it is set to minimize to the System Tray. Even worse, if your program is already accessing a library, and you start calibre, and it is set to use that library, you will get a message from calibre, saying the library is corrupt, and it only gives you two options (very remiss of Mr. Goyal :P), neither of which are acceptable in the circumstance. (1) Have calibre recreate the library based on existing files, or (2) Create a new empty library. It happened to me, even though all my program was doing was reading the library. To avoid the two options, as I had a very large library, and I did not wish to risk what either of those options might do, I just killed calibre with the Task Manager, closed my program and started calibre again ... and as I suspected, no complaints about a corrupt library, and everything works fine. I had thought to create a backup with my program anyway, but it wasn't needed.

CalibBrowser.zip  1.34 MB - Upload 4  (previous downloads: 1 + 12 + 5 + 282)

CalibBrowser (new).zip

My apologies for the program being created in AutoIt v3.3.0.0. It is the first one I have done in a while, with an older AutoIt version. Basically my Win 7 Netbook, which has a current version of AutoIt, was busy and is always busy doing something, and not suitable for doing big projects for several reasons. My older but more powerful Win XP Laptop, has a better programming environment, better computer chair (most important for my knees etc), better external monitor (wider and newish), full size external keyboard & mouse, and a great suite of setup tools to assist me. I run several older versions of AutoIt already on my Laptop, but haven't yet determined what I need to adjust to add a current version of AutoIt to the mix. This also applies to my hugely beneficial Toolbar For Any program (one of those tools), which I constantly use with SciTE. At some point, when finished, I may update the program to the current AutoIt version ... especially as I believe I am now proficient enough to do so, having become quite familiar with it in the last year or so, making many programs with it.

Enjoy!

 

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Quote

As good as calibre is, which is a great and wonderful ebook suite of tools and fair database, it does have its limitations. One of which is how it deals with multiple libraries, another is the views you get. CalibBrowser will seek to address those.

As I mentioned in the opening post of this topic, there are some limitations with calibre.

If you wish to create another Library in calibre, and copy an existing entry in your current Library to that Library, calibre duplicates the files. It doesn't support one copy of the files and then create a database file with the new library name. Nope, a new library must be in a different location, and a file called metadata.db will be the new library in that new folder ... the new library name being the name of the folder.

So every time you create a new library, a new library folder is created and a database file called metadata.db created in it.

As you can imagine, if you want an ebook to appear in a third library, a third copy of the ebook files are created. A lot of wasted space soon builds up ... especially if some ebooks run into the Mb's (graphic novels or magazines are a perfect example). I believe, that the reason, for such a structure/method, is due to the possibility of a metadata.db file becoming corrupted. In that scenario, you can simply use a calibre option, to rebuild that library, based on the files & folders in it, and the metadata.opf file found in each ebook folder.

That is a pretty simplistic approach, and I can think of at least three better ways to do that.

One of which (the best one perhaps), is to store each library an ebook belongs to, in its metadata.opf file (a simple XML one), with entries like the following.

<calibre library>Calibre Library</calibre library>
<calibre library>Magazine Library</calibre library>

Another, would be to have files like 'Calibre Library.lib' and 'Magazine Library.lib' in the ebook folder, if it belongs to those libraries.

You could also just create dummy files in a copied ebook set of folders. So just a few kb's taken up.

No doubt there are other possible methods and structures.

The first two methods support using a unique name for the database file, i.e. 'Calibre Library.db' and 'Magazine Library.db'. These can all be kept in the one place, with existing ebook folders, and no new folders needing to be created, and no ebooks files copied.

CalibBrowser will probably use both those first two methods, for its own created Libraries. Those created libraries though, will always use existing entries in a calibre library. You cannot add ebooks via CalibBrowser. Though you will be able to edit its own libraries, and removal will be possible, as will copying or moving from one created library to another ... or adding from an existing calibre library.

CalibBrowser will give you many more viewing, collecting and browsing options ... that's the plan anyway.

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Just for the record, my preferred method of use with my calibre libraries, is the following.

I like to have one basic (default) library that contains all my ebooks.

I then like to duplicate various entries into various other libraries for easier management.

Some ebooks can appear in multiple libraries. Or at least, if space wasn't wasted to do so, by duplicating files to achieve it, I would do that.

There are a few options in calibre, to seemingly assist with such desires, but I have found each one to be problematical. You can create Virtual Libraries, which I had high hopes for, but they are far too limited in how they get created. You can even add TAGS to have some method of grouping or separating, but many ebooks come with pre-existing TAGS, and I find these just cause clashes and are far from ideal, to achieve true separation like I desire. Some kind of category or collection can be done too, but that seems to be Author Name based, and it's an ALL or Nothing affair, and I have seen weird results occur ... probably TAG related.

Anyway, everything I have tried, to avoid creating my own program, has failed and is complex to do besides.

I even searched for programs others may have created, but all seem defunct now. One was even available on multiple platforms, so even allowing you to use it on your phone etc.

I gave up looking for a calibre frontend or viewer eventually. I really shouldn't take on another big project right now, but clearly I was motivated enough to do so ... or make a start anyway ... and source is provided if I fall by the wayside, and another wants to continue or get ideas.

I love calibre and Kovid Goyal for providing it, but .............

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

By the way, if you like the sound of that ebook pictured in the first post, you can get that and more for free from Smashwords.

https://www.smashwords.com/profile/view/LindsayJohannsen

 

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

If you are interested in ebooks, and one imagines that is why you are here. :D

Then you may be interested in my suite of programs, found here - KindEbook Suite.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Download in first post has been updated.

I've cleaned up the code a bit, made some a bit more modular.
I discovered how to do some more SQL things, so we are getting pretty close to 100% now with data returned. In fact 100% in my tests so far.
Thumbnail images are now clickable, so the list entry is selected and normal preview image shown.
Larger preview image now reacts to mouse position, so if mouse is moved far enough, the image closes, or stays visible for as long as you want until moved.
And yes, I remembered to disable that '3|7' text, so it no longer shows in the Book Input field.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Uploaded another update (third upload), but please note that not everything new is working yet ... or only partially.
The second row of thumbnail images work though, which you can see in the new screenshot.

I may add a third row of thumbnails yet ... depends on what else I need to add, and how much space that requires. I certainly need to have a field (list) for Series, and perhaps display Year, and maybe file sizes, etc.

I've also tidied up the code a bit more ... couple of things I overlooked last time.

This might be the last update for a short while, as life is demanding other things of me for a bit ... few days maybe.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

As usual it is hard to resist the temptation to beaver away at implementing things once I get started.

I've added some Series related fields and done a good part of the code, so many elements of it are now working, despite the complexity ... what have I let myself in for.

I may upload something today/tomorrow.

I also changed some of the controls around in the lower half of the GUI, and tied control positions for the bottom half, to the height ($height) of the GUI, which means i can adjust the middle section of the GUI at need without having to alter height values for the lower controls.

As I have placed the Series stuff in the middle of the GUI, requiring the Thumb images and adjacent controls to move downward, it is looking less likely I will add a third row of thumbnails now. Not a real great loss though, as most authors I have, only have one book anyway, and a good number that have more go beyond 15 anyway.

Talking about Series. That is also another area that calibre doesn't quite do a good enough job in. I have many books that belong to more than one series, and calibre is not really setup to deal with more than one. I will certainly be looking at a way to support such .... my head just went into a spin contemplating the complexity ... LOL.

While I hope to support whatever a current calibre user has setup, it will be true that I will be recommending a specific kind of way to use calibre, if you are also using CalibBrowser. That will mean, that both programs will work better, and less manual interaction to adapt things.

One good recommendation, is that you only have one calibre library, and instead rely on CalibBrowser to give you others. With that one calibre library, also make sure you are happy with where it is located ... perhaps on a second drive or partition if they exist in your machine, that allows for growth. I certainly would not recommend wasting space on a SSD for such data, if you have your OS on one of those ... that applies to all other sorts of data files too.

No doubt another reason for calibre to have its file & folder duplicating structure, is due to the very real possibility a user may want to relocate their library or libraries. My program CalibBrowser, will of course need to keep tabs on paths etc, and like calibre, also support rebuilding any library database file, that may become corrupt, etc. It will also support relocation.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Uploaded another update (4th upload), but please note that not everything new is working yet ... or only partially.


The middle portion of the GUI features the new Series fields, and an incomplete blank section.
First field (List) displays the authors belonging to the selected series. The second List, the Series names, which when one is selected also shows the ebooks belonging to that series

On program start, all series in the selected library, are shown in the Series list. Select an Author though, and only the Series for that Author are shown.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Finally after a long hiatus, I resumed work on CalibBrowser today, spending several hours on it. See first post for latest upload.

Quote

Implemented Series number in front of book title when Series list entry selected. Along with the series number now being shown, books are also sorted correctly.
Implemented author selection jump if typing first two characters in Author input field.
Changed the 'none' text of each list's first entry to be '_none' instead. This fixed the issue with 'no' for the new Author jump ability (when a name starts with No).
Changed the determination of thumbnails to be a function. Now works with Series, so that any required reduction occurs, and Left/Right thumb cycle buttons work correctly (see later comments).
Selecting a Series list entry now refreshes thumbs and adds '_none' as first Book list entry. WARNING - Adding '_none' may have impacted something now. Imperfect if multiple authors in the Series.
Bugfix for the entries not being cleared in some lists, when Author selected or database loaded.
Program icon created and added.
Implemented partial ability for thumbs when in Series mode, when multiple authors. This may require correct author to be selected in Series Author, before selecting book title. UPDATE - This now appears to work if no author selected, but has potential issue when the same title exists more than once in the database. Comments have been added to that section of code, and a possible solution suggested.
Added '$bkid = ""' to Books list selection, so path for VIEW and Formats etc now work properly. NOTE - Been so long since I have worked on this project, that I am no longer sure why things were like they were and what I was last working on that made them that way. I do have some recollection that there was an issue with Author names (when a multiple author name entry ... I think). I also recall the complexity of some elements was getting to me, so I suspect things were left mid testing ... no doubt also complex to undo. Something else I last recall working on, was displaying all books for a Series, regardless of the Author name ... so that may have been where the complexity lay.

When I first started CalibBrowser, there was an enthusiasm not matched by the time available to me. I did try though, and Life just caught up and I ended up juggling too much and in the end, burnt out. Of course, the amount of work involved was not fully apparent when I first started ... but hey, what's new. Seeing as I was still pretty new to SQL though, it was rather a jump in the deep end. Knowing what I was likely in for, I did keep putting it off until I felt rested and free enough.

PLEASE NOTE, as I am sure I have mentioned before, that not everything works and not everything that works, works fully or properly.

I was motivated today after having a play with the program, but anyone's guess when I will be motivated again .... but it could happen ... tomorrow even.

Enjoy!

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...