Enhancement request: Ability to customize epub catalogue tag

Bug #1262875 reported by Personal Info
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

calibre, version 1.15.0 on Windows 7 64-bit
Plugin: Catalog_EPUB_1.0.0

Tag is incorrectly spelt "catalog" vice the Queen's English "catalogue" :) :) :).

Would also like to add a prefix "_" so that it sorts at the top of a tags sort (for quick access).

This indicates that a user should probably be allowed to customize the tag completely on the initial generation dialogue then have the customization persist across invocations.

(Apologies in advance if this is the incorrect forum to post enhancement requests; please advise if so and where. Tx!)

Tags: catalogs
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1262875

Changing the component for this bug.

 assignee griker
 tag catalogs
 status triaged

Changed in calibre:
assignee: nobody → GRiker (griker)
status: New → Triaged
Revision history for this message
Katja (katjawy) wrote :

Hi Kovid,
the former mails seems to be spam. But due to them the request come into my mind again and I found a fix. I also like having Catalog with Underscore at the top. But cuuzrently it will be overwritten.

Here is my solution:

calibre/db/adding.py row 252
# matches = cache._search('title:="{}" and tags:="{}"'.format(title.replace('"', '\\"'), _('Catalog')), None)
matches = cache._search('title:="{}" '.format(title.replace('"', '\\"')), None)

calibre/db/adding.py row 263/264
# mi.tags = [_('Catalog')]
if db_id is None:
    mi.tags = [_('Catalog')]

calibre/gui2/dialogs/catalog_ui.py row 80
# self.label_2.setText(_("Catalog &title (existing catalog with the same title will be replaced):"))
self.label_2.setText(_("Catalog &title (existing book with the same title will be replaced):"))

Revision history for this message
Kovid Goyal (kovid) wrote :

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

Changed in calibre:
status: Triaged → Fix Released
Revision history for this message
Katja (katjawy) wrote :

Hi Kovid,
thanks for your help with this.
But ... sorry to say ... with the committed change, the match will not find a catalog with a different tag and therefore create a new one when the tag is changed.
The match should not search for tag=_('Catalog') anymore. Also I adjusted the dialog hint from "catalog" to "book" to be in line with the new behaviour.

calibre/db/adding.py row 252
# matches = cache._search('title:="{}" and tags:="{}"'.format(title.replace('"', '\\"'), _('Catalog')), None)
matches = cache._search('title:="{}" '.format(title.replace('"', '\\"')), None)

calibre/gui2/dialogs/catalog_ui.py row 80
# self.label_2.setText(_("Catalog &title (existing catalog with the same title will be replaced):"))
self.label_2.setText(_("Catalog &title (existing book with the same title will be replaced):"))

Revision history for this message
Kovid Goyal (kovid) wrote :

The change preserves tags other than Catalog, so leave the Catalog tag
in place and add whatever other tags you like.

Revision history for this message
Katja (katjawy) wrote :

ok, but it does not work.
The initial request is to accept beside "catalog" also "catalogue" and "_catalog".
The match calibre/db/adding.py row 252 will find all of them which is perfect.

Your change in row 263/267 prevent "hardcoding" the catalog tag which is perfect too.

But your new else-statement in row 271 is a problem as mi_tag is NONE for existing books and therefore existing tags will be overwritten.

Please remove 271 and 272 and everything works as expected.
In case the user delete all tags or use something different to *catalog*, the match will not found it and a new catalog will be created instead of overwriting which is same as old behaviour.

Revision history for this message
Kovid Goyal (kovid) wrote :
Revision history for this message
Patrsias (olivifa) wrote :

An essay is a structured written composition that explores a specific topic or argument, typically presenting analyses or viewpoints. It typically comprises an introduction, body paragraphs, and a conclusion. Essays provide a platform for individuals to express their thoughts, opinions, and insights in a coherent manner. They require critical thinking and https://www.phdresearchproposal.org/ effective communication skills to convey information and engage readers. Essays are used across various contexts, including academic, professional, and personal, to convey ideas and contribute to discourse.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.