Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-21-2024, 06:05 AM   #526
thiago.eec
Wizard
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: 1,218
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by Terisa de morgan View Post
@thiago.eec, would you accept a new Spanish translation? "Sin libros ha sido añadido a la base de datos" (or something like that) is making me crazy
Sure! I'll wait for you to send it before releasing the new version fixing @Wiggo's problem.

Last edited by thiago.eec; 09-21-2024 at 06:07 AM.
thiago.eec is online now   Reply With Quote
Old 09-21-2024, 06:34 AM   #527
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,450
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by thiago.eec View Post
I tested here using your RP column and got the same error. Apparently the switch_if function only return strings. Test the version attached version with a fix.
FWIW: All template functions return only strings. Even float and integer column references return strings.
chaley is offline   Reply With Quote
Advert
Old 09-21-2024, 06:41 AM   #528
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by thiago.eec View Post
I tested here using your RP column and got the same error. Apparently the switch_if function only return strings. Test the version attached version with a fix.
Thank you so much thiago, it works again!

Just one thing. My rereads are displayed with (1x), but are no longer in orange respectively in the rereading shelf. When I click on ‘show books records’, only the respective year is shown.

Click image for larger version

Name:	yV4XozzzcI.jpg
Views:	59
Size:	200.6 KB
ID:	210929 Click image for larger version

Name:	cHgMVmgGOu.jpg
Views:	50
Size:	297.3 KB
ID:	210930

Last edited by Wiggo; 09-21-2024 at 06:43 AM.
Wiggo is offline   Reply With Quote
Old 09-21-2024, 07:23 AM   #529
thiago.eec
Wizard
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: 1,218
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by chaley View Post
FWIW: All template functions return only strings. Even float and integer column references return strings.
Thank you for the tip. And just to be sure... is that the case even using Python mode?

Quote:
Originally Posted by Wiggo View Post
Thank you so much thiago, it works again!

Just one thing. My rereads are displayed with (1x), but are no longer in orange respectively in the rereading shelf. When I click on ‘show books records’, only the respective year is shown.
1) Mark the option 'Keep 'Rereading' color for finished books in the config dialog
2) When you are visualizing your 2024's goal, you only see records for that year. If you want to see other years too, you need to chose 'All' in the year dropdown menu.
thiago.eec is online now   Reply With Quote
Old 09-21-2024, 08:24 AM   #530
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,450
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by chaley View Post
FWIW: All template functions return only strings. Even float and integer column references return strings.
Quote:
Originally Posted by thiago.eec View Post
Thank you for the tip. And just to be sure... is that the case even using Python mode?
The formatter interpreter requires that a template function, even a user-defined one, return a string. All built-in template functions return strings.

However, it is possible to work around the formatter coercing the returned value to a string. A user-defined template function can successfully return a non-string if it is directly called by python code such as a python template. A stored python template can return a non-string if it is directly called by python code or a python template. Non-string arguments can be passed as an argument to a python stored template and a user-defined template function. These uses are edge-case, very fragile, and not recommended.

I can think of one exception to the above: using stored python templates or functions as a python code library, called by stored python templates using context.funcs. Calling via context.funcs avoids the formatter interpreter. Although this is possible, it is pushing the limits of what the template system was designed to do. I think it would be better to write this kind of code as a plugin.
chaley is offline   Reply With Quote
Advert
Old 09-21-2024, 08:37 AM   #531
thiago.eec
Wizard
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: 1,218
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
I see. I think it's better keep it simple. The plugin is just using int(str) to convert the value, since it is supposed to be a number, even if represented as a string.
thiago.eec is online now   Reply With Quote
Old 09-21-2024, 08:55 AM   #532
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by thiago.eec View Post
1) Mark the option 'Keep 'Rereading' color for finished books in the config dialog
'Keep rereading colour' is marked - never changed it
If I switch to rereading shelf, no entries as mentioned above

Quote:
2) When you are visualizing your 2024's goal, you only see records for that year. If you want to see other years too, you need to chose 'All' in the year dropdown menu.
I had forgotten that - thank you. On "All" show book records "shows" all reading dates - strange.

Should I send you the json file?

Last edited by Wiggo; 09-21-2024 at 09:00 AM.
Wiggo is offline   Reply With Quote
Old 09-21-2024, 09:10 AM   #533
thiago.eec
Wizard
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: 1,218
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by Wiggo View Post
'Keep rereading colour' is marked - never changed it
If I switch to rereading shelf, no entries as mentioned above
Choosing a rereading shelf doesn't work for you because you chose not to fill in the reading progress. Your template only gives 0% or 100%, so you will never see books under 'Reading' or 'Rereading'. That would require a value between 0 and 100.

I added some more options to the 'Rereading' shelf/color a while ago. Maybe, you need to reset your config options. Try this:

1) Uncheck all the checkboxes on the first tab of the config dialog
2) Click OK to confirm
3) Open the 'Edit reading goal' dialog and close it
4) Open the config dialog and check the boxes you want
4) Reopen the 'Edit reading goal' dialog and see if it fixed the issues

If that doesn't help, then send me your json.

Quote:
Originally Posted by Wiggo View Post
On "All" show book records "shows" all reading dates - strange.
Why do you think is strange? When you choose 'All', the plugin aggregates all your data, from all years, so all the records are there. If you choose a single year, then only that year's data is available on the records.

Last edited by thiago.eec; 09-21-2024 at 09:14 AM.
thiago.eec is online now   Reply With Quote
Old 09-21-2024, 11:15 AM   #534
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: 11,025
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
A strange behaviour that I've been wondering is intended.

I start off with a book with 0% percentread and no date. Then I add a date and delete the old entry:

Click image for larger version

Name:	2024-09-21 12_09_33-Edit reading goal.png
Views:	43
Size:	2.6 KB
ID:	210933

However, upon the next update:

Click image for larger version

Name:	2024-09-21 12_11_57-Edit reading goal.png
Views:	42
Size:	2.5 KB
ID:	210934

To get around this, I instead set it to 1%, then back to 0% before deleting the two old entries:

Click image for larger version

Name:	2024-09-21 12_14_08-Edit reading goal.png
Views:	43
Size:	3.5 KB
ID:	210935

Click image for larger version

Name:	2024-09-21 12_16_03-Edit reading goal.png
Views:	44
Size:	3.0 KB
ID:	210936
ownedbycats is online now   Reply With Quote
Old 09-21-2024, 11:24 AM   #535
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by thiago.eec View Post
Choosing a rereading shelf doesn't work for you because you chose not to fill in the reading progress. Your template only gives 0% or 100%, so you will never see books under 'Reading' or 'Rereading'. That would require a value between 0 and 100.

I added some more options to the 'Rereading' shelf/color a while ago. Maybe, you need to reset your config options. Try this:

1) Uncheck all the checkboxes on the first tab of the config dialog
2) Click OK to confirm
3) Open the 'Edit reading goal' dialog and close it
4) Open the config dialog and check the boxes you want
4) Reopen the 'Edit reading goal' dialog and see if it fixed the issues

If that doesn't help, then send me your json.
Didn't work.

Quote:
Why do you think is strange? When you choose 'All', the plugin aggregates all your data, from all years, so all the records are there. If you choose a single year, then only that year's data is available on the records.
Strange in that respect, because the entry is there, but no colour.

Edit: Sent you a PM

Last edited by Wiggo; 09-21-2024 at 11:28 AM.
Wiggo is offline   Reply With Quote
Old 09-21-2024, 11:44 AM   #536
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,637
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by thiago.eec View Post
Sure! I'll wait for you to send it before releasing the new version fixing @Wiggo's problem.
I've shared the files with you.

Last edited by Terisa de morgan; 09-21-2024 at 11:47 AM. Reason: I'd forgotten attachments are not allowed
Terisa de morgan is offline   Reply With Quote
Old 09-23-2024, 07:39 AM   #537
thiago.eec
Wizard
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: 1,218
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by ownedbycats View Post
A strange behaviour that I've been wondering is intended...
First, every book must have at least one record. So, when you add a book to your goal, a record is set (in your case, a 0% record).

Now, you must understand that the main entry for the book is constantly updated with the latest metadata. This is not a 'record' per se. If you delete all records, the main entry still have the current values from your calibre library.

When you delete the 0% record, it is in fact deleted. But, since you cannot have zero records, a new record will be created with the current value the next time you interact with the plugin. If you don't want a 0% record, you can add the book and wait to delete the 0% record on your next update.

Since I want a 0% record (so my reading speed is correctly calculated), this is how I do it:

1) I add the book to my goal with 0% (the date doesn't matter);
2) Then, when I start reading, I update the date
3) Open the Edit Reading Goal dialog and delete the old entry
4) Then, I open again the Edit dialog, so a new updated record is created
5) The next day, let's say I read 20% and update it

Now, I have a dated 0% record marking my start and a 20% record the next day.

P.S.: Now that you mentioned, I think step 4 could be eliminated by adjusting the code to created the new record immediately, when all records have been deleted.

Quote:
Originally Posted by Wiggo View Post
Didn't work.

Strange in that respect, because the entry is there, but no colour.

Edit: Sent you a PM
Now I see the problem. The plugin is using the color only for the current year, but no for past years. I'll fix it.

Quote:
Originally Posted by Terisa de morgan View Post
I've shared the files with you.
Thank you Terisa. I'll add it on the next update.
thiago.eec is online now   Reply With Quote
Old 09-23-2024, 09:51 AM   #538
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: 11,025
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by thiago.eec View Post
Since I want a 0% record (so my reading speed is correctly calculated), this is how I do it:

1) I add the book to my goal with 0% (the date doesn't matter);
2) Then, when I start reading, I update the date
3) Open the Edit Reading Goal dialog and delete the old entry
4) Then, I open again the Edit dialog, so a new updated record is created
5) The next day, let's say I read 20% and update it

Now, I have a dated 0% record marking my start and a 20% record the next day.
Yeah, I want a dated 0% record. I add the book to the goal with an empty date and then add it when I'm about to start reading.

I followed your instructions and it worked
ownedbycats is online now   Reply With Quote
Old 09-23-2024, 11:49 AM   #539
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by thiago.eec View Post
Now I see the problem. The plugin is using the color only for the current year, but no for past years. I'll fix it.
And once again many thanks.
Wiggo is offline   Reply With Quote
Old 09-23-2024, 03:28 PM   #540
thiago.eec
Wizard
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: 1,218
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Version 1.6.7 - 23 Sep 2024

- Bug fix: ensure the 'Keep Rereading color' option works for past years too
- Bug fix: when deleting the last record, create a new updated one immediately, instead of waiting for the next interaction
- Updated ES translation

Last edited by thiago.eec; 09-23-2024 at 03:31 PM.
thiago.eec is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Reading List kiwidude Plugins 1426 07-29-2025 06:31 PM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 05:25 AM
Reading Goal KyBunnies Audiobook Discussions 12 10-25-2017 05:29 PM


All times are GMT -4. The time now is 08:34 PM.


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