![]() |
#421 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
And yes, just go to the next tag. Hopefully the code works. Last edited by ownedbycats; 10-10-2022 at 11:33 AM. |
|
![]() |
![]() |
![]() |
#422 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
For a template search, is there a way to search for 'template returns any value'?
e.g. the first search I did via a GPM if-then returning 'yes' but there might be a better way. |
![]() |
![]() |
Advert | |
|
![]() |
#423 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
EDIT: like this (screen capture) Last edited by chaley; 10-30-2022 at 04:52 PM. Reason: Added screen capture |
|
![]() |
![]() |
![]() |
#424 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That works! I should check tooltips more often.
|
![]() |
![]() |
![]() |
#425 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Code:
program: round(days_between($#filedate, $date)) EDIT: Also, is there a better way to search that both columns have the same calendar date? MCS failed. Last edited by ownedbycats; 11-23-2022 at 05:00 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#426 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#427 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,772
Karma: 30237628
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
MM is Month because it's bigger than a minute.
BR |
![]() |
![]() |
![]() |
#428 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#429 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That works.
![]() |
![]() |
![]() |
![]() |
#430 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Code:
program: ## Splitting tags if '^(Fiction|Nonfiction)' in $#booktype then split_tags = re($tags, '\.', ',') fi; ## Removing a few unwanteds cleaned_tags = list_difference( split_tags, 'Fiction, Nonfiction, Cultures & Regions, Social Issues', ','); 1. Retrieve tags when the booktype is Fiction|Nonfiction. 2. Replace the '.' with a ',' to turn hierarchical tags into a list. 3. Remove a few unwanted entries from the list. It works... mostly. If booktype is not Fiction|Nonfiction, it returns EXCEPTION: Interpreter: Unknown identifier 'split_tags' - line number 12. What should I do? EDIT: I found that also adding a second if-then check for Fiction|Nonfiction before cleaning the tags works. Last edited by ownedbycats; 11-25-2022 at 06:50 AM. |
![]() |
![]() |
![]() |
#431 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: Is it possible to reference a grouped search in a template?
|
![]() |
![]() |
![]() |
#432 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#433 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Something like if 'value' in groupsearch (or inlist?) where groupsearch was a few related columns.
I suppose for this case it might make more sense to just combine them together in the template itself with a list_join or something. |
![]() |
![]() |
![]() |
#434 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
A different question:
I have this for a column. Code:
program: first_non_empty( if 'Cleanup' in virtual_libraries() then 'polish.png' fi, if 'Fanfiction' in $#booktype then icons_fanfic() fi, if 'Documentations & Manuals' in $#booktype then 'helpbook.png' fi, if 'Loans' in virtual_libraries() then 'overdrive.png' fi, if 'Physical Books' in virtual_libraries() then 'paperbook.png' fi, 'view.png', ) Code:
program: f = $#fanficcat; strcat( if "^Fallout$" inlist f then 'fallout.png:' fi, if "^Half-Life$" inlist f then 'halflife.png:' fi, if "^(Mass Effect Trilogy|Mass Effect: Andromeda)$" inlist f then 'masseffect.png:' fi, if "^The Elder Scrolls$" inlist f then 'theelderscrolls.png:' fi, if "^Pokémon$" inlist f then 'pokemon.png:' fi, if "^Portal$" inlist f then 'portal.png:' fi, ) If it's possible, it seems the easiest way to do this would be to truncate at the first colon so the output is, e.g. fallout.png instead of fallout.png:halflife.png:. Is this doable? EDIT: list_split is what i was looking for! Code:
if 'Fanfiction' in $#booktype then list_split(icons_fanfic(), ':', 'ff'); ff_0 fi, Last edited by ownedbycats; 11-27-2022 at 03:46 AM. Reason: fixing indenting |
![]() |
![]() |
![]() |
#435 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
To do what I think you want you need to invoke the search. For example, if you want to know if a gst will match the current book then something like this: Code:
program: globals(ids = ''); if ! ids then ids = book_values('id', '@gst:true', ',', 0); set_globals(ids) fi; $id in ids |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Library Management: various questions not worth their own thread | ownedbycats | Library Management | 225 | 08-04-2025 06:31 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 |