![]() |
#106 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I fixed my saved search & replace!
|
![]() |
![]() |
![]() |
#107 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Code:
program: s = $#kobostatus; c = $#kobocoll; first_non_empty ( contains(s, "Send to Device", 'sync.png', ''), contains(s, "Kobo Store", 'drm-locked.png', ''), contains(s, "On Loan", 'overdrive.png', ''), contains(c, "[Want to Buy]", 'cart_full.png',''), contains(s, "Sideloaded", 'reader.png',''), ) Last edited by ownedbycats; 06-21-2021 at 03:09 PM. |
![]() |
![]() |
![]() |
#108 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Last edited by chaley; 06-21-2021 at 05:10 PM. Reason: Spelling |
|
![]() |
![]() |
![]() |
#109 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Oh, that makes sense. I removed the brackets and it worked and still matched.
|
![]() |
![]() |
![]() |
#110 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: Due to that composite column recursion glitch, I did this to avoid using variables in the template:
Code:
program: if $#fanficcat && $#currentlyreading && $#kobobookmark then strcat(format_number(subtract((re($#kobobookmark, '.*\/file(\d+).*', '\1')), 1), '{0:,d}'), '/',$$#chaptercount) fi Code:
program: input = $#kobobookmark; a = re(input, '.*\/file(\d+).*', '\1'); if $#fanficcat && $#currentlyreading && $#kobobookmark then strcat(format_number(subtract(a, 1), '{0:,d}'), '/',$$#chaptercount) fi ideally, it'd also check that $#kobobookmark starts with OEBPS/file but I've not quite figured out how to get it working yet. ![]() Last edited by ownedbycats; 06-29-2021 at 01:01 PM. |
![]() |
![]() |
![]() |
#111 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
Code:
&& substr(a, 0, 10) == 'OEBPS/file' |
||
![]() |
![]() |
![]() |
#112 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I had to change a to input, but that worked in the template tester. Unfortunately I can't get Calibre to run from source anymore so I'm not sure if it actually works in the column itself.
EDIT: Until I fix the source issue (posted in development about it), I just subbed in my old code and put $#kobobookmark into the OEBPs test. That worked. ![]() ANOTHER EDIT: Installing the Calibre beta lets me run from source again. it works. Actually since the beta also includes the recursion fix I can just use that. Last edited by ownedbycats; 06-30-2021 at 12:43 AM. |
![]() |
![]() |
![]() |
#113 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
New question: Is count reserved and not for variables? It turned blue.
As a sidenote, I finally realized that if I use enter on the composite column and open the editor directly without going through the "add column" dialog I don't have to restart Calibre. ![]() Last edited by ownedbycats; 06-30-2021 at 01:19 AM. |
![]() |
![]() |
![]() |
#114 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Real reserved words such as 'if' and 'for' cannot ever be used as variables. Quote:
![]() I use F2 because I use enter to edit metadata. |
||
![]() |
![]() |
![]() |
#115 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I tried using it for a gpm template and got some unexpected outputs. So I changed it to ccount (for #chaptercount) instead.
I rarely pay attention to the last modified column anyways because it seems even sneezing causes it to change. ![]() Last edited by ownedbycats; 06-30-2021 at 12:37 PM. |
![]() |
![]() |
![]() |
#116 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Which is one of the reasons I always run from code. Fiddling with the columns in a database is not a reason to update the last modified timestamp of the records. I've spent to much time preventing that during far to many database migrations. Of course, it does depend on what the fiddling is, but, I definitely don't consider this to be valid reason.
|
![]() |
![]() |
![]() |
#117 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
last_modified is for internal calibre use, its how calibre keeps track of whichbackup opf files need to be re-done. And editing column definitions definitely requiresthem to be re done. last_Modified, explicitly *does not* mean the last time the user edited the books metadata.
|
![]() |
![]() |
![]() |
#118 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Unfortunately, most people do interpret last_Modified as when the metadata was last changed. They use it to decide things like if a book needs to be sent to their device or if they need to do some sort of work on the book. But, I don't. I interpret it as when the last time something about that book changed. But, I completely disagree that changing the column definition is changing the book. Some changes yes, but, if I change the display format of a number to include a percent sign, I don't consider that is a change to the data, just how it will be shown in some place. Changing last_modified just seems wrong for this. The same goes for changing a template or the list of values for a "Text, but with a fixed set of permitted values" (if I removed a value being used, that is different case). Adding or removing a column is a little different, but, I still would tend to not change the last_modified. If the issue is to trigger the backup of the OPF files, then using "mark_as_dirty" with a parameter to not call "update_last_modified" should do it. The only thing missing is clearing some caches, but, as you need to reboot calibre after these changes, that will happen then. Of course, triggering that isn't hard to do. And for the record, I had not realised that using "Queue all books for backup" would update last_modified. I suppose that demonstrates it is not a useful value for users and probably should not be displayed. And searching the code, I can't see anywhere that it is actually used. It gets set, but, I can't see anything that actually does something with it. From your comment, I was expecting to find tests using it. |
|
![]() |
![]() |
![]() |
#119 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Are text and tag-likes formatted differently in the OPFs? that may make a difference.
|
![]() |
![]() |
![]() |
#120 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,741
Karma: 30237526
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Library Management: various questions not worth their own thread | ownedbycats | Library Management | 225 | 07-27-2025 02:07 PM |
[Metadata Source Plugin] Questions regarding parse select, docs and ref templates | Boilerplate4U | Development | 13 | 07-07-2020 02:35 AM |
Questions on Kobo [Interfered with another thread topic] | spdavies | Kobo Reader | 8 | 10-12-2014 11:37 AM |
[OLD Thread] Some questions before buying the fire. | darthreader13 | Kindle Fire | 7 | 05-10-2013 09:19 PM |
Thread management questions | meme | Feedback | 6 | 01-31-2011 05:07 PM |