View Single Post
Old 08-22-2023, 09:56 AM   #1
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 942
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
[GUI Plugin] Reading Goal

This plugin was created to help you manage your annual Reading Goal and keep a reading record over the years.

Main Actions:
  1. Add to reading goal:
    • Add the selected books to your current reading goal
    • Books already in your reading goal will be ignored
    • If you checked the option Allow adding other year's reading goal, you will be prompted to confirm the year (automatically fetched from selected books). Note that every book must have the same year to be added in batch.
  2. Remove from reading goal:
    • Remove the selected books from your reading goal
    • Books not in your reading goal will be ignored
  3. Edit reading goal:
    • Here you can see all the books in your current reading goal
    • Books are automatically organized in shelves (Want to read, Reading and Read), based on their reading progress
    • Besides overseeing your reading goal, you can edit it:
      • Link to another book: you can change the calibre book linked to this entry. Useful in case you want to change the edition you are reading, or when the original book in your library was removed, leaving the entry orphaned
      • Remove from reading goal: remove the book from you reading goal, just like using the main menu option. No record is kept.
      • Mark the book as abandoned: differently from removing, the existing records are kept, and the last reading progress still counts for your goal statistics. Abandoned books will not be updated or moved to your next year's goal.
      • Show book's records: manage your reading records for this book. A new record is created every time you change your reading progress. You can delete past records, but not the current one.
        • Delete this record: if the book has more than one reading record, you will see this button for past records.
    • Changes will be committed only when you hit Apply
  4. Statistics:
    • Here you have multiple graphics and statistics:
      • Readings by month
      • Readings by genre (top 12)
      • Annual readings
    • You can also see the statistics for past years, if they are present

Plugin options:
  1. Custom columns: you must set the first three custom columns. Only columns of the right type will be available in the dropdown list.
    • Reading progress: integers, floating point numbers or composite
    • Status date: date
    • Page count: integers
    • Genre: text, composite. This column is not mandatory, but if you don't set it, then you will not have a 'Genre view'.
    • You can create new custom columns, if you don't want to use the existing ones, by pressing the icon. Create all the columns you want before exiting the config dialog. You will be prompted to restart calibre.
  2. Customize interface:
    • Main button: choose which action will be performed when clicking the plugin icon on the toolbar
    • Sort by: choose how books should be sorted on the Edit reading goal dialog
  3. Auto add to goal:
    • If you use other plugins that sync your reading activity, like Goodreads Sync or Skoob Sync, you might want to automatically add your books from a Want to read shelf. To accomplish this, you need to configure your sync plugin to use the same column selected here.
    • To trigger the auto add, this column just need to be set for the book, with any value. You can also check for a specific value, but only for some column types: bool, int, float or text. If the selected column is of one of those types, a value field will be available.
    • Notice that all values are converted to string before comparing.
  4. Auto backup:
    • Set up an interval for automatic backups. If you leave it empty, no automatic backups will be made.
    • You can also restore a backup file from the config dialog
  5. Main options:
    • Migrate unfinished books to the next year's goal: if you check this option, when a new year starts, all books on your Want to read and Reading shelves will be moved to your current year reading goal.
      • Your reading progress for the last year will not be taken into account when calculating your current year statistics
      • Abandoned books will not be moved
    • Allow adding other year's reading goal: if you check this option, when adding books to your goal, you will be prompted to confirm the year (automatically fetched from selected books). Note that every book must have the same year to be added in batch.
    • Use 'Rereading' shelf: If you check this option, books that you already read before, will be added to a Rereading shelf.
    • Use a 'Rereading' color, instead of a shelf: Check this option to use a different color for rereadings.
    • Use a rereading counter: Check this option to add a counter for how many times you've reread the book.
    • Keep 'Rereading' color for finished books: If you check this option, it will retain the line color for books migrating from the 'Rereading' shelf to the 'Read' shelf.
    • Jump to the selected book: If you check this option, when opening the 'Edit reading goal' dialog, it will jump to the selected book in your calibre library.
  6. Display options:
    • Auto collapse: List the shelves you want to be collapsed when opening the 'Edit reading goal' dialog. Use a comma separated list with the shelves numbers. Example: 1, 3, 5.
    • Shelf colors: Set the color for each shelf on the 'Edit reading goal' dialog. Use a python dictionary with shelf number and RGB value. Example: {1: (180, 230, 255), 3: (250, 190, 80)}.

Database information:
  1. The plugin does not modify your calibre library. Its database is kept in a JSON file saved to your calibre config directory (AppData\Roaming\calibre\plugins, for Windows).
  2. Each calibre library has its own database, but the same columns must be used, since there is no library specific setting for custom columns
  3. The database uses the book id as a key to store the book info. So, if you remove a book, the link will be lost and you will be prompted to relink it.
  4. On the Edit reading goal dialog, you can backup/import/clear your database.
  5. Be careful when importing a new database: the current one will be completely replaced by the imported file. It's recommended to first backup your current database, so you can restore it in case anything goes wrong.

Requirements:
  • calibre 6.0 or later

Installation Steps:
  • Download the attached zip file and install the plugin > add to context menu or toolbar > restart calibre as described in the Introduction to plugins thread.

Getting Help:

If you need assistance using this plugin, you can check out the built-in help dialogs by clicking on the '?' icon in the upper right corner of the dialog window. Then, hover your mouse over the options, and click when the cursor changes to an arrow and a question mark.

If any doubt still persists, feel free to ask here. Also, suggestions are welcomed!

License: GNU General Public License v3 (GPL-3)

Latest calibre version tested: 7.10

Version History:
Spoiler:

Version 1.5.6 - 21 May 2024
- Fix a division by zero error

Version 1.5.6 - 20 May 2024
- Add a tooltip to the page count column: x pages/day | y days to finish

Version 1.5.5 - 23 Apr 2024
- Add a tooltip with the full datetime for the date column

Version 1.5.4 - 11 Apr 2024
- Add two more options to control rereadings

Version 1.5.3 - 10 Apr 2024
- Bug fix: convert the old 'backup_date' setting to the new format (library specific)

Version 1.5.2 - 10 Apr 2024
- Auto backup: create library associated backups

Version 1.5.1 - 07 Apr 2024
- Just a small change: don't wait 24h to consider a new day when checking for a new backup

Version 1.5.0 - 06 Apr 2024
- Add a 'Restore backup' button to the config dialog, so the user can load a valid database file in case the 'Edit reading goal' dialog can't be opened

Version 1.4.0 - 06 Apr 2024
- New feature: Auto backup: now you can set up automatic backups for your database, so in case anything goes wrong, you can use the last working backup

Version 1.3.0 - 27 Mar 2024
- Bug fix: handle malformed hierarchical tags (ending with a trailing dot)

Version 1.2.9 - 19 Mar 2024
- Bug fix: after making a change to the challenges, the delete and edit buttons would become available even for the 'Annual' challenge.

Version 1.2.8 - 06 Feb 2024
- Fix for rereading detection

Version 1.2.7 - 16 Jan 2024
- Fix a bug introduced by the last release, causing an error when trying to link an existing record to a new book

Version 1.2.6 - 03 Jan 2024
- Bug fix: deleting past year's records would copy all the books from that year to the current year's goal

Version 1.2.5 - 01 Jan 2024
- Fix for rereading count: only count books already finished (reading progress = 100%)
- Fix for 'Division by zero' error in Statistics (for the first day of the year)

Version 1.2.4 - 01 Jan 2024
- Fix for rereading count: only count books already started (reading progress > 0%)
- Fix for empty Summary after migrating books from last year
- Fix for auto migrate: delete existing challenges and make 'last_year_pages' to be changed only for the new year
- Fix for 'Division by zero' error in Statistics

Version 1.2.3 - 08 Nov 2023
- Fix for date sorting: it uses the timestamp now
- Add a confirmation dialog when deleting books from your goal (you can skip it by unchecking the 'Show this confirmation again' checkbox)

Version 1.2.2 - 23 Out 2023
- Fix for title sorting: always use 'Title sort', except when the user explicitly choose 'Title'.
- New options:
  • Jump to the selected book when opening the 'Edit reading goal' dialog
  • Auto collapse: list the shelves you want to be collapsed when opening the 'Edit reading goal' dialog
  • Shelf colors: set the color for individual shelves

Version 1.2.1 - 28 Sep 2023
- Fix for reading progress sorting
- All years view: when pressing the 'Show book records' button, it will display all the records for reread books

Version 1.2.0 - 21 Sep 2023
- Fix for book records display when sorting by 'Date (desc)'
- Spanish translation updated by @dunhill

Version 1.1.9 - 20 Sep 2023
- Fix for empty dates preventing the 'Show records' button to work
- Improved the auto add feature: instead of searching the database, now it adds the book when a change to the auto add column is detected

Version 1.1.8 - 18 Sep 2023
- Add to reading goal: Added an extra message if the books are already in the database, and they were just updated
- Add a genre view for the 'All' years option
- Fix for repeated genres in different levels (e.g.: 'Mystery' and 'Fiction.Mystery') no being correctly displayed
- Fix for adding books to an empty database when the 'Allow other years' option is checked (this was fixed before, but came back)
- Fix for 'Mark selected books' when clicking on the shelves' names. Now it marks all the books in that shelf.

Version 1.1.7 - 17 Sep 2023
- Fix a remaining timezone issue for book records

Version 1.1.6 - 16 Sep 2023
- Fix a regression in 1.1.4 that broke adding books for past years using just the year

Version 1.1.5 - 16 Sep 2023
- Fix a regression in 1.1.4 that broke date automatic update (all dates were the same)

Version 1.1.4 - 16 Sep 2023
- Add a 'Date' option when adding books from other years, so the user can enter the date manually
- Fix for composite column returning a string, instead of an integer/float

Version 1.1.3 - 11 Sep 2023
- Fix for custom challenges with empty databases
- Fix for adding books to an empty database when the 'Allow other years' option is checked

Version 1.1.2 - 10 Sep 2023
- Accept composite columns for reading progress

Version 1.1.1 - 10 Sep 2023
- Fix the error for autoadd values
- Fix for records being incorrectly sorted

Version 1.1.0 - 06 Sep 2023
- Added two new graphics for the 'Statistics' dialog: Readings by Genre, Annual readings
- Added custom challenges:
  • Challenges must be set within the current year
  • Only ongoing challenges can have books added/removed
  • The challenge progress is updated when one of its books reaches 100% within the set time frame
- Edit reading goal dialog: Add an 'All' option to the 'Year' dropdown menu
- New option: Keep 'Rereading' color for finished books
- New option: Sort by Date
- Fix a regression that caused an error when adding a book already present on another year
- Fix for the library association dialog being shown repeatedly

Version 1.0.9 - 01 Sep 2023
- Now, every calibre library has its own database
- Added an option to use or not a 'Rereading' shelf
- When a book on your 'Rereading' shelf reaches 100%, it will be moved to the 'Read' shelf (keeping the reread count)
- Spanish translation by @Terisa de morgan


Version 1.0.8 - 29 Aug 2023
- Fix adding a book with empty date causing an error when opening the dialogs
- Add a 'Mark selected books' button to the 'Edit reading goal' dialog
- Add a clear database button
- Restored the right buttons for other years (relinking will be inactive)
- Expanded the rereading algorithm to include rereading in the same year (triggered by new records after reaching 100%)
- Improved contrast for disabled buttons on dark mode

Version 1.0.7 - 29 Aug 2023
- Fixed the timezone issue, that could cause wrong dates because of the UTC offset
- Fixed the algorithm to detect rereads, so the adding order won't matter
- Fixed the error thrown when no Genre column was set
- Fix for empty entries being left behind and causing errors
- Fixed an error when adding books to other years: the current year's books were also being added in the process, leading to many duplicates
- Fix for the Auto Fill function, causing the first book added being deleted
- Other small bug fixes
- Removed future years from the statistics dialog, since they don't have any statistics
- The 'Remove from goal' button (on the Edit Reading goal dialog) now is accessible for other years. Up until now, there was no option to remove books from other years.

Version 1.0.6 - 27 Aug 2023
- Bug fix for another regression introduced in version 1.0.4 (error for books with no genre column set)

Version 1.0.5 - 27 Aug 2023
- Bug fix for a regression introduced in the last release (error with books with no date)

Version 1.0.4 - 27 Aug 2023
- Added a 'Genre view' option for the 'Edit reading goal' dialog
- Added a 'Year' dropdown menu for the 'Edit reading goal' dialog, so you can view details of your past goals
- Added a 'Rereading' shelf: books already read in past goals will be displayed here, with a counter for rereadings - e.g.: 'Lord of the flies (2x)'
- Added a Schema Version property to the database, so we can manage breaking changes
- Bug fixes

Version 1.0.3 - 23 Aug 2023
- Fix a typo found by @BeckyEbook

Version 1.0.2 - 23 Aug 2023
- Prevent the use of localized strings in the database and config JSON, as this may cause problems when the user changes its interface language

Version 1.0.1 - 22 Aug 2023
- Minor bug fix for book selection

Version 1.0.0 - 22 Aug 2023
- Initial release of Reading Goal plugin
Attached Thumbnails
Click image for larger version

Name:	Statistics.png
Views:	770
Size:	19.3 KB
ID:	203283   Click image for larger version

Name:	Options.png
Views:	688
Size:	31.9 KB
ID:	203284   Click image for larger version

Name:	Edit reading goal.png
Views:	631
Size:	70.1 KB
ID:	203434  
Attached Files
File Type: zip Reading_Goal_v_1.5.7.zip (365.1 KB, 81 views)

Last edited by thiago.eec; 05-21-2024 at 06:28 PM. Reason: Version 1.5.7
thiago.eec is offline   Reply With Quote