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

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 01-19-2025, 06:16 PM   #46
correoparaappzz
Connoisseur
correoparaappzz began at the beginning.
 
Posts: 54
Karma: 10
Join Date: Nov 2023
Device: Kindle Oasis
Quote:
Originally Posted by chaley View Post
An implementation of per-value icons is in calibre source. It works in the GUI and in the content server.

Here is the documentation from the manual, with some formatting changed:
so if i wanted the series that only have 1 book to have a specific icon it won't work?

correoparaappzz is online now   Reply With Quote
Old 01-19-2025, 10:22 PM   #47
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,268
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by correoparaappzz View Post
so if i wanted the series that only have 1 book to have a specific icon it won't work?

That might be possible because the tag browser already has a count of books for a value. I'll see if this can be passed to the template as a variable. Average rating is also probably available.

I'm less sure about whether a value has notes or links. I'll check.
chaley is offline   Reply With Quote
Advert
Old 01-21-2025, 05:24 PM   #48
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,268
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
These changes are in calibre source:
  • Make the book count available to an icon template as the variable 'count'. This is the same number one sees in the tag browser.
  • Make the average rating available as 'avg_rating'. This is also the same number one sees in the tag browser.
  • Add a menu action to remove all value icons from a category.
  • Add an "icon rules viewer" tab to Look & feel / Tag browser. You can see all the rules. Rules can be deleted. They can't be edited.
  • The same tab has two new checkboxes: "Show icons on categories in the tag browser" and "Show icons on values in the tag browser". Unchecking the box removes the icon.

There are still some potential problems with using database functions(has_note(), book_count(), etc.) in value icon templates in both the GUI and the content server. I hope to fix these in the next day or so.

This is the new "Value icons rules viewer" tab.
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	121
Size:	154.5 KB
ID:	213209  
chaley is offline   Reply With Quote
Old 01-21-2025, 09:17 PM   #49
correoparaappzz
Connoisseur
correoparaappzz began at the beginning.
 
Posts: 54
Karma: 10
Join Date: Nov 2023
Device: Kindle Oasis
Quote:
Originally Posted by chaley View Post
These changes are in calibre source:
  • Make the book count available to an icon template as the variable 'count'. This is the same number one sees in the tag browser.
  • Make the average rating available as 'avg_rating'. This is also the same number one sees in the tag browser.
  • Add a menu action to remove all value icons from a category.
  • Add an "icon rules viewer" tab to Look & feel / Tag browser. You can see all the rules. Rules can be deleted. They can't be edited.
  • The same tab has two new checkboxes: "Show icons on categories in the tag browser" and "Show icons on values in the tag browser". Unchecking the box removes the icon.

There are still some potential problems with using database functions(has_note(), book_count(), etc.) in value icon templates in both the GUI and the content server. I hope to fix these in the next day or so.

This is the new "Value icons rules viewer" tab.
so, this is for the next preview or release?
correoparaappzz is online now   Reply With Quote
Old 01-21-2025, 10:24 PM   #50
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,537
Karma: 7095191
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by correoparaappzz View Post
so, this is for the next preview or release?
We can't know for sure but when I want to take a peek at latest features, here's what i do:

download this:

https://github.com/kovidgoyal/calibr...ads/master.zip

or...

https://github.com/cbhaley/calibre/a...ads/master.zip

then extract that to some folder and run the attached script.

(in this case I've set path to C: just for simplifying purpose)

edit: make sure there are no calibre instances running before running from source.
Attached Files
File Type: bat calibre-dev.bat (61 Bytes, 54 views)

Last edited by Comfy.n; 01-21-2025 at 10:26 PM.
Comfy.n is offline   Reply With Quote
Advert
Old 01-22-2025, 02:24 AM   #51
un_pogaz
Chalut o/
un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.
 
un_pogaz's Avatar
 
Posts: 436
Karma: 145424
Join Date: Dec 2017
Device: Kobo
When I first saw the icon rule viewer, displaying the internal value assosiated to template bothered me a little because it wasn't {template} and so is wasn't consistent with other locations when a template is used to generate value. It really stuck in my mind for a while, but I couldn't find a way to write a good code to proposal.
Here my suggestion: Since the column "Use for children", write then a text {template}.

...
And now that I think about it, maybe it would be better than the internal value TEMPLATE_ICON_INDICATOR use " {template} " has value directly rather than " template " as is currently the case. Hm, it broke a bit if the user and test the feature on preview, but it's the risk of using preview and it will better display the fact that this icon rule is a template generator (instead that my suggestion above).

Last edited by un_pogaz; 01-22-2025 at 02:37 AM.
un_pogaz is offline   Reply With Quote
Old 01-22-2025, 05:36 AM   #52
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,268
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by correoparaappzz View Post
so, this is for the next preview or release?
Saying "These changes are in calibre source" means that they are available now to people who run calibre from source and the changes will be in the next release (preview or release). Of course there is no guarantee that nothing will change between the commit to source and the release. This happens frequently because of problems found by people who run from source.
chaley is offline   Reply With Quote
Old 01-22-2025, 05:40 AM   #53
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,268
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by un_pogaz View Post
When I first saw the icon rule viewer, displaying the internal value assosiated to template bothered me a little because it wasn't {template} and so is wasn't consistent with other locations when a template is used to generate value. It really stuck in my mind for a while, but I couldn't find a way to write a good code to proposal.
Here my suggestion: Since the column "Use for children", write then a text {template}.

...
And now that I think about it, maybe it would be better than the internal value TEMPLATE_ICON_INDICATOR use " {template} " has value directly rather than " template " as is currently the case. Hm, it broke a bit if the user and test the feature on preview, but it's the risk of using preview and it will better display the fact that this icon rule is a template generator (instead that my suggestion above).
I originally did something like your first proposal but ran into problems with using the text as the dict key. I decided to make things easy and use the key directly, which meant using TEMPLATE_ICON_INDICATOR. Now that all the infrastructure changes are done I will go back to the browser. What I am looking at is adding icons saying what the value is using a different value for templates by using custom QTableWidgetItems.
chaley is offline   Reply With Quote
Old 01-22-2025, 06:23 AM   #54
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,268
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The following changes are now in source. Most were provoked by ensuring that displaying composite columns and icons in the content server works.
  • In the GUI:
    • GPM templates work as before. Note that in icon rule templates there is no book data so field-based functions such as format_date_field(), list_count_field(), and check_yes_no() won't work.
    • Python templates have full access to the calibre database.
  • In the content server:
    • Templates have access to the new API but not the old API (LibraryDatabase).
    • Because of the above, the following formatter functions are not guaranteed to work in GPM templates (composite columns, icon rules, etc) and should be avoided if you use the content server.
      • connected_device_name()
      • connected_device_uuid()
      • current_virtual_library_name()
      • is_marked()
      • virtual_libraries()
chaley is offline   Reply With Quote
Old 01-22-2025, 09:09 AM   #55
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,268
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
@un_pogaz: Here is a capture of the dialog that I submitted to Kovid
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	121
Size:	183.4 KB
ID:	213223  
chaley is offline   Reply With Quote
Old 01-22-2025, 09:55 AM   #56
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,300
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
That looks good.
ownedbycats is offline   Reply With Quote
Old 01-22-2025, 11:02 AM   #57
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,268
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The dialog changes are now in source.
chaley is offline   Reply With Quote
Old 01-23-2025, 04:42 AM   #58
un_pogaz
Chalut o/
un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.
 
un_pogaz's Avatar
 
Posts: 436
Karma: 145424
Join Date: Dec 2017
Device: Kobo
Fancy, neat. Thanks.
un_pogaz is offline   Reply With Quote
Old 01-23-2025, 07:17 PM   #59
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,300
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I tried it and ran into a strange behavior: If I select mulitple entries and then delete them, only one (the last selected) gets deleted. Intended?

Also, can access the template dialog from preferences?

Last edited by ownedbycats; 01-23-2025 at 09:11 PM.
ownedbycats is offline   Reply With Quote
Old 01-23-2025, 09:53 PM   #60
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,268
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
I tried it and ran into a strange behavior: If I select mulitple entries and then delete them, only one (the last selected) gets deleted. Intended?
Multiple selection wasn't supposed to be implemented. I pushed a change to turn it off.
Quote:
Also, can access the template dialog from preferences?
What do you mean?
chaley 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
Can I disable Icons in Tag Browser? mikhail_fil Library Management 1 08-10-2023 06:34 PM
Lighter icons in tag browser? polymerwitch Calibre 3 11-29-2021 06:21 PM
Category Ranges in Tag Browser BetterRed Library Management 7 10-18-2020 04:44 AM
Any way to unhide just one user category in the tag browser? ownedbycats Library Management 2 10-14-2020 09:10 PM
Show Category in Tag Browser MerlinMama Calibre 4 02-01-2016 11:11 AM


All times are GMT -4. The time now is 02:17 PM.


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