|
|
Thread Tools | Search this Thread |
07-22-2016, 08:54 PM | #31 |
null operator (he/him)
Posts: 20,655
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Hmmm, that's what I imagined it was - but I couldn't believe it. Back to the future, Compuserve, Usenet and all that. As you say 1980's stuff.
Encode your Blu-Ray movies and store them in the calibre database, now why would I want to do that - apart from 'cos I now can. Perhaps in the hope that someone will write a calibre plugin that reads a movie and reproduces the screenplay using reverse engineering - as an EPUB of course BR |
07-22-2016, 09:01 PM | #32 |
Grand Sorcerer
Posts: 12,250
Karma: 74007256
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Sounds like uuencode / uudecode or the more modern MIME
|
Advert | |
|
07-22-2016, 09:02 PM | #33 |
Deviser
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
You could store all book covers and books themselves in a single database file. 1 file Calibre library. Base64 is usually zipped on encode and unzipped on decode to save space.
|
07-22-2016, 09:47 PM | #34 |
Deviser
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
Modern web browsers convert the base64 images from text to what you see on the screen. Look at the web page source for wikipedia or google search, and do a find on base64. Google serves up many images as base64 text, and the browser decodes them to .png or .jpg or .gif that are displayed on your screen as a picture.
|
07-23-2016, 05:09 AM | #36 |
Grand Sorcerer
Posts: 11,774
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
When I made the suggestion to add other content types I was mainly thinking about images. I can imagine several reasons someone would want an image (other than the cover) displayed in book details and also want that image to travel with the database.
More esoteric possibilities include:
The reason I suggested base64 is risk reduction. There are many "clients" that look at comments fields: internal calibre, plugins, third party apps, etc. All of these expect to find text that may or may not be HTML. These clients are almost certainly not prepared to handle non-text data, for example images. If they encounter non-text data a very likely outcome is a crash. Base64 results in valid text. Clients may display something strange, but they won't crash. If the developer cares then the client can be changed to do the right thing with the data. FWIW: I would prefer a single drop down box that is not editable. That box would contain the content types known by calibre at that moment. Plugins could set the content-type to something else. The reason: if there is both a boolean and a content type then code must check both instead of only one. There is the possibility of mistakes where one is set but not the other. Lastly the meaning isn't always clear. Does plain_text == True + content-type == text/plain mean the same thing as plain_text + content-type == empty? Can I set a content type without setting base64? Also FWIW: base64 is used in lots of current protocols. For example, email is often stored and transmitted in base64. As DaltonST said, base64 is used in HTML, for example in IMG tags with src="data:image/png;base64,...". One finds it in interchange formats such as XML and JSON when there isn't a convenient text representation of the data. |
07-23-2016, 07:14 AM | #37 |
creator of calibre
Posts: 43,994
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I really dont want to encourage people to start storing arbitrary binary data in the DB. Remember that the entire DB is always loaded into RAM. Storing files/images/etc. in the DB is really not a good idea.
As such I have implemented support for plain text and markdown, but that's about as far as I am willing to push this. |
07-23-2016, 11:27 AM | #38 |
Grand Sorcerer
Posts: 11,774
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@Kovid: I should have remembered that you would think that way about adding significant "stuff" to the database. After all, we had that discussion recently. Apologies for bringing it up again, albeit indirectly.
I pulled the changes and (what a surprise ) they work. I note that 'interpret_as' is overloaded to control on which side of book details the column appears, with short-text appearing on the left and the other three (html, long-text, and markdown) appearing on the right. This means that I cannot have a column containing only a hyperlink or some other short HTML item appear with a label in the left side of the panel. I see why you didn't choose to use show_heading to determine which side of book details the items appears. That would overload its meaning in the same way "interpret_as" is being overloaded, removing an option that is useful. The question: does it make sense to you to have another boolean to indicate that the item is to be shown on the left in book details? The boolean widget would be enabled only if show_label is true, or alternatively checking it would force show_label to be true. As far as I can see, the new boolean would be used only in render.py near line 101, where a choice is made to use ans.append instead of adding the value (and the label) to the list of comments. Something like: Code:
if disp.get('show_heading'): if disp.get('show_on_left'): ans.append((field, row % (name, val))) continue val = '<h3 class="comments-heading">%s</h3>%s' % (p(name), val) If you think this is an OK change to make but don't want to do it yourself, I can do it. It should touch only the column creation code and render.py. EDIT: The changes were easy enough that I went ahead and pushed them. Last edited by chaley; 07-23-2016 at 12:21 PM. |
07-23-2016, 11:40 AM | #39 |
Grand Sorcerer
Posts: 11,774
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@Kovid: create_custom_column.ui has disappeared from the source, replaced by setup_ui in create_custom_column.py. Shouldn't the inheriting from Ui_QCreateCustomColumn also be removed? I tried it and the dialog works fine with it gone, but I don't know what the side effects might be.
|
07-23-2016, 01:16 PM | #40 | |
creator of calibre
Posts: 43,994
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
07-23-2016, 01:19 PM | #41 | |
creator of calibre
Posts: 43,994
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
|
|
07-23-2016, 02:57 PM | #42 | |
Grand Sorcerer
Posts: 11,774
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
07-23-2016, 10:08 PM | #43 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
|
07-23-2016, 11:09 PM | #44 |
Deviser
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
The key word is "it". What "it" was defined to be varied quite a bit by who was defining "it". What was just implemented is now the official definition of "it".
As the saying goes, 'if you want "it" done right, then do "it" yourself'. |
07-23-2016, 11:12 PM | #45 |
creator of calibre
Posts: 43,994
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
As DaltonST said, there were a lot of alternate proposals floating around, so I realized that doing it myself would actually take less time than reviewing someone else's code and getting them to implement it in exactly the flavor I wanted. But, yeah, when it comes to self control with work, I suffer from a total absence
|
Tags |
custom field, plain-text |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Yes/No Field doesn't appear in browser and can't search on it | spedinfargo | Library Management | 3 | 01-02-2014 08:32 PM |
Problem with Tag Browser Custom Icon for Languages | MartyTX | Library Management | 1 | 02-03-2013 03:44 AM |
Calibre always freezes with tag browser shown | Noughty | Calibre | 38 | 10-17-2011 01:19 PM |
Y/N custom column in Tag Browser? | matthewdeans | Calibre | 15 | 08-12-2011 02:01 PM |
Creating a Short Text Column that Doesn't Appear in Tag Browser? | shocampo | Calibre | 2 | 09-12-2010 01:35 PM |