Skip to content
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

Show empty library in case search doesn't match anything #251

Merged
merged 2 commits into from
Mar 1, 2023
Merged

Show empty library in case search doesn't match anything #251

merged 2 commits into from
Mar 1, 2023

Conversation

schroda
Copy link
Collaborator

@schroda schroda commented Feb 25, 2023

In case the search didn't match anything all mangas where shown instead of an empty library.

return filteredManga;
};
): IMangaCard[] =>
performSearch(query, manga).filter((m) => downloadedFilter(downloaded, m) && unreadFilter(unread, m));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filtering the manga, before calling performSearch should increase the performance for large libraries

Copy link
Collaborator Author

@schroda schroda Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right it's not optimal currently.
I think the best way should be to perform search and filter on each manga in one go.
I'll open a new pr for that

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nervermind, changed it in this pr

return filteredManga;
};
): IMangaCard[] =>
performSearch(query, manga).filter((m) => downloadedFilter(downloaded, m) && unreadFilter(unread, m));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
performSearch(query, manga).filter((m) => downloadedFilter(downloaded, m) && unreadFilter(unread, m));
performSearch(query, manga.filter((m) => downloadedFilter(downloaded, m) && unreadFilter(unread, m)));

something like this

In case the search didn't match anything all mangas where shown instead of an empty library.
Copy link
Contributor

@akabhirav akabhirav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AriaMoradi AriaMoradi merged commit c6257ac into Suwayomi:master Mar 1, 2023
@schroda schroda deleted the fix/library_search_respect_query_without_results branch March 11, 2023 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants