View Single Post
Old 06-21-2014, 03:33 PM   #1
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
[GUI Plugin] Author Book Count

This plugin updates a new custom column for the total number of books written by each author. This is done for every book in your library. It provides functionality that standard Calibre does not provide, specifically the ability to search using queries constructed with integers for an integer custom column. Example: ((#abc_numeric:">6") and (#abc_numeric:"<47")). Also, its normal ABC column in the Tag Browser has full Tag Browser functionality based specifically on ABC.

Also see: "Author Book Count Hierarchy", a plugin designed for perusing complex Co-Author relationships, not just ABC counts.


Main Features ABC:

This plugin updates a custom column for the total number of books for an author for each book of each author in your library. It always updates all books in the open library. The results are displayed in the left browser pane under "ABC". A menu selection to "Read Instructions" is available.

Installation Notes:
  1. Calibre > Preferences > Custom Columns > Add a new custom column called "author_book_count" with a title of "ABC" and with the default "text, with column shown in the tag browser". Uncheck the new column to hide it. Save your work and restart Calibre. Refer to the attached configuration image file.
  2. Calibre > Preferences > Plugins > Load Plugin from File and load the attached zip file. Save your work and restart Calibre.
  3. Calibre > Preferences > Toolbar > Main Menu Toolbar and then add the icon for Author Book Count. Save your work. Close the window.
  4. If you don't want to see the count in the Book Details view, go to Calibre > Preferences > Look and Feel > Book Details and customize the view to your taste.
  5. The Calibre tag-browser defaults to sorting by Text instead of by Numbers within Text. To change this: Calibre > Preferences > Tweaks > Recognize Numbers Within Text When Sorting > and set numeric_collation = True. See the attached image file for reference.
  6. Optionally, you may create a second new custom column called “abc_numeric”. Choose the type as “integer”. This custom
    column will be populated with the integer version of author_book_count, but only if the column exists. Search criteria valid only for integers would then be possible, such as: #abc_numeric:">7"


Execution Notes:
  1. Click the icon for Author Book Count. Agree to continue, and it will execute. It has been optimized for speed, so it is very fast.
  2. You should not be running any other jobs when you run ABC. It is very fast, averaging in testing ~1 second per ~1,000 ebooks.


Special Notes:
  1. Requires Calibre version 6.0.0 or later.

  2. Bear in mind that a single book has a single author book count, so anthologies with a dozen authors will show the count for the author that has the lowest Calibre author id, which is to say the author that was first added to Calibre. If you see a discrepancy between the tag browser for ABC and the books shown in the window, simply right click one of their books and then > Similar Books > Books by Same Author. You should then see the books for which that author was one of multiple authors, and was not the first author listed in the list of authors. This behavior is not a bug, but rather the nature of having only a single value for a single custom column for a single book in Calibre. The count is correct, but the browser pane info on the left of the main gui has to be interpreted properly for books with multiple authors.
  3. Remember to back up your metadata.db file(s) not infrequently, and especially before starting Installation Step 1, above.
  4. This plugin does not update any ebooks or "real" metadata other than the linked new custom column that you defined in Installation Step 1, above.
  5. This plugin can be safely and simply uninstalled and the custom column and associated custom column data deleted via Preferences > Plugins > Remove and also Preferences > Custom Columns > Delete if you so desire.
  6. It is advisable to compact your Calibre metadata.db database periodically. The menu path is Calibre > Library > Library Maintenance > Check Library. It will perform a SQLite Vacuum operation to condense/compact/defrag the database. Example before and after a Vacuum:

    Before compacting<<<----------->>>After compacting:
    Page Count = 118,342<<<---------->>>Page Count = 3,606
    Database Size = 121,182,208 bytes<<>>Database Size = 3,692,544 bytes
    So, the metadata.db file went from over 121mb to less than 4mb in size.
  7. This plugin does not directly interact with the ABC Hierarchy plugin. Each has a different purpose. Use one or both; it is up to you.

Version History:
Spoiler:

Version 2.2.3 - 07 January 2023 Qt.core. Minimum Calibre Version: 6.0.0
Version 2.2.2 - 03 February 2021 Translation to Spanish.
Version 2.2.0 - 17 December 2020 Miscellaneous technical changes to improve performance.
Version 2.1.9 - 19 December 2019 Technical changes after Python 3.8 testing with Calibre 4.99.2
Version 2.1.8 - 16 December 2019 Technical Tweaks after compiling with Python 3.8
Version 2.1.7 - 22 July 2019 Technically restructured and simplified to improve performance.
Version 2.1.6 - 23 May 2019 Python 3 compatibility.
Version 2.1.5 - 05 May 2017 Allow themes with user-defined icons.
Version 2.1.4 - 16 May 2016 Changes for use by the Favourites Plug-in.
Version 2.1.3 - 22 June 2015 Changes to make ABC consistent with ABCH
Version 2.1.2 - 22 June 2015 Improved user experience when executing repetitively in multiple Calibre libraries continuously.
Version 2.1.1 - 21 June 2015 Miscellaneous performance tweaks.
Version 2.1.0 - 6 June 2015 Many Technical Changes to Improve Performance and Ease of Use.
Version 2.0.2 - 5 September 2014 Changes due to Calibre 2.2.0 Refactor
Version 2.0.1 - 24 August 2014 Max ABC Increased to 5000
Version 2.0.0 - 7 August 2014 Optional new custom column abc_numeric
Version 1.1.0 - 28 July 2014 Minor Technical and Functional enhancements.
Version 0.1.0 - 21 June 2014 Initial release of the Author Book Count plugin.
Attached Thumbnails
Click image for larger version

Name:	Using_ABC_plus_ABCHierarchy_plus_3d_Custom_Column_Simultaneously.JPG
Views:	4337
Size:	50.9 KB
ID:	126382  
Attached Files
File Type: pdf abc_instructions.pdf (405.5 KB, 2712 views)
File Type: zip author_book_count.zip (626.1 KB, 46679 views)

Last edited by DaltonST; 01-08-2023 at 04:58 PM. Reason: New Version 2.2.3
DaltonST is offline   Reply With Quote