mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
When finding similar books by author ignore "et al." suffix on author names. Fixes #2116804 [[Enhancement] Books by same author should ignore "et al."](https://bugs.launchpad.net/calibre/+bug/2116804)
This commit is contained in:
parent
1ddbaa2bd8
commit
aa2aef48f8
@ -85,6 +85,11 @@ class SimilarBooksAction(InterfaceAction):
|
|||||||
|
|
||||||
if isinstance(val, string_or_bytes):
|
if isinstance(val, string_or_bytes):
|
||||||
val = [val]
|
val = [val]
|
||||||
|
if typ == 'authors':
|
||||||
|
import re
|
||||||
|
def remove_et_al(au):
|
||||||
|
return re.sub(r'\s+et al\.$', '', au)
|
||||||
|
val = list(map(remove_et_al, val))
|
||||||
search = [col + ':"='+t.replace('"', '\\"')+'"' for t in val]
|
search = [col + ':"='+t.replace('"', '\\"')+'"' for t in val]
|
||||||
if search:
|
if search:
|
||||||
self.gui.search.set_search_string(join.join(search),
|
self.gui.search.set_search_string(join.join(search),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user