-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds search by genre to WebUI #238
Conversation
ca0269c
to
5caaf64
Compare
const titleFilteredManga = manga.filter((m) => queryFilter(query, m)); | ||
const genreFilteredManga = manga.filter((m) => queryGenreFilter(query, m)); | ||
const unique = titleFilteredManga.concat(genreFilteredManga).reduce((acc: Record<number, IMangaCard>, obj) => { | ||
const { id } = obj; | ||
if (!acc[id]) { | ||
acc[id] = obj; | ||
} | ||
return acc; | ||
}, {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will keep the mangas that matched by title above the ones that matched by genre. I am working on a more streamlined version that gives a rank to manga objects while filtering, and sorts accordingly. Could be more performant
@@ -63,15 +64,12 @@ const filterManga = ( | |||
} | |||
return acc; | |||
}, {}); | |||
return Object.values(unique); | |||
filteredManga = Object.values(unique); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this commit reverts #226.
not sure how everyone else sees this, but I'd like to be able to search my whole library and not just the filtered one (e.g. downloaded, unread), since otherwise, if you want to open a manga that is not included in the filters, you have to unset the filters everytime you search for something like that (and set them again after you've found the manga)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not how the app works? If you want to search something that is not downloaded then you remove the filter and search for it, right?
It felt like a bug that my filters were not being honored when I searched for my manga
I believe we should stick close to the app implementation. If setting and unsetting the filters are cumbersome or buggy we could improve the experience there. I will adhere to the consensus. But, I think we should keep this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never used the app (don't have an android), so I can't say.
I guess it's preference. I expected it to search my whole library (or at least the category, since whole library is not possible).
since I know what I'm searching for (a specific title), I wouldn't want a filter to mess with it.
if it should work like the app, what about adding some kind of flag to search all mangas/ignore filters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a good workaround, but for that we need to clarify the following details
- Whether this preference will be stored in localStorage or sever [Probably server, but putting this in server, would need input from others]
- Where can users find this preference(Settings page or somewhere else) [ Probably Settings page ]
- Will it be on/off by default [I prefer off, i.e. search will respect filter as OOB experience]
- Any other solutions like displaying a fab while searching and if filters are active, to quicky disable the filters(either for that search or permanently) [I like this idea, but will take much more time/brain to implement]
- Should it be done in this PR or another [I prefer another PR]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@schroda any opinions on these? I'd like to get this PR reviewed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I'd say server as well
- maybe the library "settings" (filter, sort, ui), or a settings button inside the search, which is only visible when search is open?
- should be the same as the app then, so disabled
- I wouldn't mess with the filters, since it's also not really required for it to work
- yes, should be done in another pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6caf0ed
to
6a3f7c5
Compare
What
As the title says, this feature will allow you to use the search input with genre as well. You can input comma separated genre to search by them
Note: You need to put the full genre text (case does not matter)
Why
Searching by genre is very cool, it has the ability to give you exactly what you are in the mood for. Want something that has a lot of action in it, but also monsters. Type in
action, monster
and it will give you all the mangas in your library that are tagged with themDisclaimer: Search by genre is subject to information provided by extension and sources. So if your source/extension does not provide proper genre details, this will not work