01-15-2022, 01:29 PM | #931 |
Junior Member
Posts: 4
Karma: 10
Join Date: Oct 2017
Device: ipad
|
Thanks for the link. That solved the problem.
However, the question remains as to how it got changed. |
01-15-2022, 01:44 PM | #932 | |
Grand Sorcerer
Posts: 11,773
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The first line of that post is (emphasis added)
Quote:
|
|
01-15-2022, 02:04 PM | #933 |
Wizard
Posts: 1,114
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
|
To add to what chaley said, the plugin restores the search back to what it was after it finishes. Since in your case calibre crashed, the restore step never happened.
|
01-18-2022, 08:33 AM | #934 |
Leftutti
Posts: 406
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
|
Hi capink,
it is possible to separate the aliases like in the normal authors (black instead of blue ampersand)? I have a group-search "pen-names" with authors and #alias and do my similar authors search by this pen-names. If I search for "Robert Lynn Asprin" all the books with Robert Asprin & Co-Author will not be found, because the alias is e.g. "Robert Lynn Asprin & Linda Evans" and not "Robert Lynn Asprin" & "Linda Evans". I hope I expressed it clearly |
01-18-2022, 09:48 AM | #935 | ||
Wizard
Posts: 1,114
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
|
Quote:
Quote:
Code:
def evaluate(self, formatter, kwargs, mi, locals, val, col_name, user_cat_prefix):
new_val = ''
if hasattr(mi, '_proxy_metadata'):
all_cats = mi._proxy_metadata.user_categories
cats = {k:v for k,v in all_cats.items() if k.startswith(user_cat_prefix)}
SEP = mi.metadata_for_field(col_name)['is_multiple'].get('list_to_ui', '')
new_val = set()
if SEP:
val_ = val.split(SEP)
else:
val_ = [val]
for user_cat, v in cats.items():
repl = user_cat.lstrip(user_cat_prefix)
for user_cat_item, src_cat in v:
if src_cat == col_name:
for item in val_[:]:
if item == user_cat_item:
new_val.add(repl)
val_.remove(item)
else:
new_val.add(item)
if new_val:
return ', '.join(list(new_val))
return val
Edit: Alternatively, you can keep your original setup, and modify your search from: Code:
#alias:"=Robert Lynn Asprin" Code:
#alias:"Robert Lynn Asprin" Last edited by capink; 01-18-2022 at 11:01 AM. |
||
01-18-2022, 09:57 AM | #936 | |
Grand Sorcerer
Posts: 11,773
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Ahh, but this is supported only in is_multiple text columns, not composite columns. |
|
01-18-2022, 10:00 AM | #937 | |
Wizard
Posts: 1,114
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
|
Quote:
Edit: I just read the second part of you reply. |
|
01-18-2022, 10:09 AM | #938 |
Grand Sorcerer
Posts: 11,773
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I realized after writing my post that you are talking about composite columns. That is why I added the qualifier about "Contains names" appearing only on is_multiple text columns.
Random thought: I haven't taken the time to understand exactly what you are trying to do, but it seems that you are trying to populate a column with the list of alternate names for the authors. Why not do this with action chains, where the chain modifies a "standard" is_multiple composite that has "Contains names" checked? The chain would trigger when a book is modified, updating the target column. |
01-18-2022, 10:25 AM | #939 | |
Wizard
Posts: 1,114
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
|
Quote:
Last edited by capink; 01-18-2022 at 10:42 AM. |
|
01-18-2022, 10:25 AM | #940 |
Well trained by Cats
Posts: 29,944
Karma: 55705602
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I have the same Grouped Search (penned_as)
It links the normal Authors and my custom column #pseudo4 (Ampersand separated text) As Chaley suspects, the column type is not appropriate |
01-18-2022, 12:40 PM | #941 | |
Leftutti
Posts: 406
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
|
Quote:
The fuzzy search of Find Duplicates works pretty well for me so far, therefore and because I was overwhelmed by the rest of your tutorial I'll stick with it for now. I got the idea from you - belated thank you! |
|
01-18-2022, 01:07 PM | #942 |
Wizard
Posts: 1,114
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
|
If you are using commas instead of ampersands, do not tick the option "composite has names" in the Find Duplicates.
|
01-18-2022, 01:33 PM | #943 |
Leftutti
Posts: 406
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
|
thx!
Regarding the Action Chain, even though I actually have no clue. If I understood the problem with the names, the ampersands and the multiple composite columns correctly, chaley's solution doesn't work either, because these columns don't have "Contains names", right? |
01-18-2022, 01:44 PM | #944 | |
Grand Sorcerer
Posts: 11,773
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
However, if what you have is working then it is probably best to stick with it. Action chains can require substantial template-fu. |
|
01-19-2022, 05:30 AM | #945 |
Leftutti
Posts: 406
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
|
OK, I understand.
Of course I stick with "mine" as I have no idea about templates and stuff like that |
Tags |
cross library duplicates, in library duplicates |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] View Manager | kiwidude | Plugins | 415 | 05-11-2024 03:28 AM |
[GUI Plugin] Quality Check | kiwidude | Plugins | 1184 | 04-17-2024 06:17 PM |
[GUI Plugin] Open With | kiwidude | Plugins | 403 | 04-01-2024 08:39 AM |
[GUI Plugin] Generate Cover | kiwidude | Plugins | 811 | 03-16-2024 11:31 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |