LibriVox / librivox-catalog

LibriVox catalog and reader workflow application
https://librivox.org
MIT License
36 stars 17 forks source link

Be able to narrow down the author choice in Template Generator #197

Open twinkietoes-on opened 4 months ago

twinkietoes-on commented 4 months ago

https://librivox.org/add_project

When typing in a common surname for the author, or one that is a partial match to a lot of other names, it returns a long list. Example: typing in "Smith" gives you "Grossmith" and every other surname that contains "Smith" somewhere in it, and the list is getting unwieldy. There's no way to narrow it down (for example, you can't type the first/given name to narrow the list).

I don't know the best solution, but we do need a way to narrow down this list for people to find the author to select; otherwise, they'll give up and make a duplicate author.

peterjdann commented 2 weeks ago

Seems to me the behaviour we see here would be better if:

This change would be pretty easy to implement, and while it wouldn't completely solve the OP's problem, it might go some way to allleviating the pain.

redrun45 commented 2 weeks ago

@peterjdann: Thank you, Peter! I was going to close this ticket now that we have the ability to search using both fields. I didn't want to "mess things up" for people who were used to the current sorting, but this does seem like an improvement to me. I'll see what folks think.

Since names are involved, our search must be fuzzy, so there are plenty of edge cases ("Smith" gives "George Grossmith", "Mary" gives "Bithia Mary" Croker and "Lady Mary" Loyd)... but at first blush, this "opposite field sort" seems best in more situations overall.

redrun45 commented 2 weeks ago

@peterjdann, let's talk about this a bit more. For convenience, here's that PDF doc with screenshots of what #232 would do.

Seems to me the behaviour we see here would be better if: In a case where the user has specified only an author surname, the results were sorted by first name

I've probably misread your comment here. I thought you were suggesting to sort primarily by first name, but you were suggesting to add it as a secondary sort column! We definitely should have a secondary sort column, but you've got me thinking of which it should be. 😉

Thanks to your trick with TRIM(), (and a little more confidence in COALESCE() to fix the pseudonym-sorting problem), here's what it might look like if we did what I thought you meant! Please let me know what you think.

When searching by last name, ORDER BY first_name, last_name (compare to first page of screenshots): Author-Dropdown-AltFieldSort-Last George Grossmith is in there somewhere, but he's not before Aaron Smith anymore!

Then when searching by first name, ORDER BY last_name, first_name (compare to second page): Author-Dropdown-AltFieldSort-BothFields Drat those Fredericks - the Earl and the Reverend! Titles cannot be fully accounted for, no matter what field we sort by. 😆

Same last_name, first_name order, when searching only by first name: Author-Dropdown-AltFieldSort-First Adopting your 'Mary' example, consider "Mary Electa Adams" and "Mary Matthews Adams". Is it more useful for them to be sorted primarily by their middle/maiden names (usually part of the first_name field), or by their last names? There are still a lot of edge cases, but I think this gives better results overall.

If you think #232 is better, then I'll show you the pseudonym fix to add to it, and we can present both options. 😉

peterjdann commented 1 week ago

Sorry it's taken me a few days to get to look at this properly. I think the way you've tackled this is far better than my own version. I don't see any value in presenting both options at all.

What is the best way for us to proceed now to get your change implemented? I'd be perfectly happy to have my own pull request aborted/cancelled/deleted (not quite sure how this works) if the easiest way to get this done would be for you to raise a fresh pull request that implements the change whose effects you've illustrated above.

redrun45 commented 1 week ago

Honestly, having two options is good in any case! If you'd like to cancel #232 for now, I have no objections, but we'll at least still have the screenshots. I'll see what other admins think about them, and then I can put up either version (with added pseudonym fix) for technical review. :+1:

peterjdann commented 1 week ago

Honestly, having two options is good in any case! If you'd like to cancel #232 for now, I have no objections, but we'll at least still have the screenshots. I'll see what other admins think about them, and then I can put up either version (with added pseudonym fix) for technical review. 👍

I've closed #232. I think you solution is much better!