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

Introduced override filters while searching setting #242

Merged
merged 6 commits into from
Mar 4, 2023

Conversation

akabhirav
Copy link
Contributor

@akabhirav akabhirav commented Feb 15, 2023

What

This PR introduces a new setting called Ignre Filters while Searching. This setting as it says determines whether manga search will respect the filters that are set such as Downloaded, Unread, etc.

Why

This will resolve a previous issue that some users had with the search behaviour which resulted in #226. This PR completely ignores the filters while searching. This PR is middle ground to keep most users satisfied with the Web UI behaviour

@akabhirav akabhirav force-pushed the override-filters-search branch from 9cc4aee to a57b46b Compare February 15, 2023 11:24

const setSettingValue = (key: keyof ISearchSettings, value: boolean) => {
requestUpdateServerMetadata(metadata ?? {}, [[key, value]]).catch(() =>
makeToast('Failed to save the default reader settings to the server', 'warning'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

you forgot to update the error message (still says reader settings)

<ListItemIcon>
<SearchIcon />
</ListItemIcon>
<ListItemText primary="Override Filters when Searching" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

what do you think about something like "Ignore filters while searching"? I feel like that is easier to understand then "Override"

overrideFilters: false,
} as ISearchSettings);

const getReaderSettingsWithDefaultValueFallback = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as for the error message, name inlcudes "ReaderSettings"

@akabhirav akabhirav requested a review from schroda March 4, 2023 07:43
@@ -53,12 +54,12 @@ const filterManga = (
query: NullAndUndefined<string>,
unread: NullAndUndefined<boolean>,
downloaded: NullAndUndefined<boolean>,
overrideFilters: boolean,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think "ignoreFilters" would be better fitting over all.
"overrideFilters" sounds to me like the filters will get replaced with different ones, while they are just ignored if the flag is set to true

src/typings.ts Outdated
@@ -81,7 +81,7 @@ export interface IMetadataHolder<VALUES extends AllowedMetadataValueTypes = stri

export type AllowedMetadataValueTypes = string | boolean | number | undefined;

export type MangaMetadataKeys = keyof IReaderSettings;
export type MangaMetadataKeys = keyof (IReaderSettings & ISearchSettings);
Copy link
Collaborator

Choose a reason for hiding this comment

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

AppMetadataKeys should be a better place to add the type, since the search settings aren't really part of the mangas

@akabhirav akabhirav requested a review from schroda March 4, 2023 15:17
Copy link
Collaborator

@schroda schroda 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 a67370b into Suwayomi:master Mar 4, 2023
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