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

Add logic to only update specific categories #520

Conversation

schroda
Copy link
Collaborator

@schroda schroda commented Mar 12, 2023

Makes it possible to only update specific categories.

In case a manga is in an excluded category it will be excluded even if it is also in an included category.

@schroda schroda force-pushed the feature/global_update_only_update_specific_categories branch 2 times, most recently from 0594d3d to c70c1a9 Compare March 13, 2023 01:19
@schroda schroda force-pushed the feature/global_update_only_update_specific_categories branch from c70c1a9 to 682975a Compare March 13, 2023 01:52
@schroda schroda marked this pull request as draft March 20, 2023 00:58
@schroda schroda marked this pull request as ready for review March 20, 2023 22:12
@schroda schroda force-pushed the feature/global_update_only_update_specific_categories branch from 682975a to 6afa94b Compare March 22, 2023 20:54
@schroda schroda requested a review from Syer10 March 22, 2023 20:56
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

enum class IncludeInUpdate(@JsonValue val value: Int) {
EXCLUDE(0), INCLUDE(1), UNSET(2);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is UNSET 2 and not 0? I image 0 as a sane default

Copy link
Collaborator Author

@schroda schroda Mar 23, 2023

Choose a reason for hiding this comment

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

no real reason, I just went with boolean (0 = false/exclude, 1 = true/include) which left 2 for UNSET

Copy link
Member

Choose a reason for hiding this comment

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

well if we are mapping to numbers, -1 would be better for UNSET as it's not a natural number.

Copy link
Member

Choose a reason for hiding this comment

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

But all things considered, as this is not c/c++ it doesn't matter which number we are mapping to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I also thought about -1, I prefer that over having UNSET as 0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed it to -1

@schroda schroda force-pushed the feature/global_update_only_update_specific_categories branch 2 times, most recently from c557c45 to 2b6a751 Compare March 23, 2023 18:25
@AriaMoradi
Copy link
Member

Fix merge conflicts

@schroda schroda force-pushed the feature/global_update_only_update_specific_categories branch 2 times, most recently from 9e146bc to 120a7f1 Compare March 25, 2023 20:59
@AriaMoradi
Copy link
Member

Fix merge conflicts

Makes it possible to only update specific categories.

In case a manga is in an excluded category it will be excluded even if it is also in an included category.
@schroda schroda force-pushed the feature/global_update_only_update_specific_categories branch from 120a7f1 to 0b8df4b Compare March 27, 2023 14:50
@schroda
Copy link
Collaborator Author

schroda commented Mar 27, 2023

Fix merge conflicts

done

@AriaMoradi AriaMoradi merged commit d3aa321 into Suwayomi:master Mar 27, 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