-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logic to only update specific categories
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.
- Loading branch information
Showing
7 changed files
with
73 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
server/src/main/kotlin/suwayomi/tachidesk/manga/model/dataclass/CategoryDataClass.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
package suwayomi.tachidesk.manga.model.dataclass | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue | ||
|
||
/* | ||
* 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); | ||
|
||
companion object { | ||
fun fromValue(value: Int) = IncludeInUpdate.values().find { it.value == value } ?: UNSET | ||
} | ||
} | ||
|
||
data class CategoryDataClass( | ||
val id: Int, | ||
val order: Int, | ||
val name: String, | ||
val default: Boolean, | ||
val includeInUpdate: IncludeInUpdate, | ||
val meta: Map<String, String> = emptyMap() | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...main/kotlin/suwayomi/tachidesk/server/database/migration/M0026_CategoryIncludeInUpdate.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package suwayomi.tachidesk.server.database.migration | ||
|
||
/* | ||
* 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/. */ | ||
|
||
import de.neonew.exposed.migrations.helpers.AddColumnMigration | ||
import suwayomi.tachidesk.manga.model.dataclass.IncludeInUpdate | ||
|
||
@Suppress("ClassName", "unused") | ||
class M0026_CategoryIncludeInUpdate : AddColumnMigration( | ||
"Category", | ||
"include_in_update", | ||
"INT", | ||
IncludeInUpdate.UNSET.value.toString() | ||
) |