|
|
#421 | |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,373
Karma: 79699999
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 12:33 PM. |
|
|
|
|
|
|
#422 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,373
Karma: 79699999
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,526
Karma: 8065948
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 05:52 PM. Reason: Added screen capture |
|
|
|
|
|
|
#424 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,373
Karma: 79699999
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,373
Karma: 79699999
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 06:00 AM. |
|
|
|
| Advert | |
|
|
|
|
#426 | ||
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
|
||
|
|
|
|
|
#427 |
|
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,036
Karma: 30277960
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,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
|
|
|
|
|
#429 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,373
Karma: 79699999
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That works.
I also could've added #filedate:true to the search.
|
|
|
|
|
|
#430 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,373
Karma: 79699999
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 07:50 AM. |
|
|
|
|
|
#431 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,373
Karma: 79699999
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,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
|
|
|
|
|
#433 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,373
Karma: 79699999
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,373
Karma: 79699999
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 04:46 AM. Reason: fixing indenting |
|
|
|
|
|
#435 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
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
|
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Library Management: various questions not worth their own thread | ownedbycats | Library Management | 253 | 10-21-2025 09:15 AM |
| [Metadata Source Plugin] Questions regarding parse select, docs and ref templates | Boilerplate4U | Development | 13 | 07-07-2020 03:35 AM |
| Questions on Kobo [Interfered with another thread topic] | spdavies | Kobo Reader | 8 | 10-12-2014 12:37 PM |
| [OLD Thread] Some questions before buying the fire. | darthreader13 | Amazon Fire | 7 | 05-10-2013 10:19 PM |
| Thread management questions | meme | Feedback | 6 | 01-31-2011 06:07 PM |