mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Add support to update strategy on global update (#7902)
* Add support to update strategy. * Add JavaDoc and bump the LIB_VERSION_MAX constant. * Fix a word typo. * Store update strategy enum as integer in the DB.
This commit is contained in:
parent
29fa93e829
commit
ba533f30ce
19 changed files with 89 additions and 11 deletions
|
@ -20,6 +20,8 @@ interface SManga : Serializable {
|
|||
|
||||
var thumbnail_url: String?
|
||||
|
||||
var update_strategy: UpdateStrategy
|
||||
|
||||
var initialized: Boolean
|
||||
|
||||
fun getGenres(): List<String>? {
|
||||
|
@ -50,6 +52,8 @@ interface SManga : Serializable {
|
|||
|
||||
status = other.status
|
||||
|
||||
update_strategy = other.update_strategy
|
||||
|
||||
if (!initialized) {
|
||||
initialized = other.initialized
|
||||
}
|
||||
|
@ -64,6 +68,7 @@ interface SManga : Serializable {
|
|||
it.genre = genre
|
||||
it.status = status
|
||||
it.thumbnail_url = thumbnail_url
|
||||
it.update_strategy = update_strategy
|
||||
it.initialized = initialized
|
||||
}
|
||||
|
||||
|
|
|
@ -18,5 +18,7 @@ class SMangaImpl : SManga {
|
|||
|
||||
override var thumbnail_url: String? = null
|
||||
|
||||
override var update_strategy: UpdateStrategy = UpdateStrategy.ALWAYS_UPDATE
|
||||
|
||||
override var initialized: Boolean = false
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package eu.kanade.tachiyomi.source.model
|
||||
|
||||
/**
|
||||
* Define the update strategy for a single [SManga].
|
||||
* The strategy used will only take effect on the library update.
|
||||
*
|
||||
* @since extensions-lib 1.4
|
||||
*/
|
||||
enum class UpdateStrategy {
|
||||
/**
|
||||
* Series marked as always update will be included in the library
|
||||
* update if they aren't excluded by additional restrictions.
|
||||
*/
|
||||
ALWAYS_UPDATE,
|
||||
|
||||
/**
|
||||
* Series marked as only fetch once will be automatically skipped
|
||||
* during library updates. Useful for cases where the series is previously
|
||||
* known to be finished and have only a single chapter, for example.
|
||||
*/
|
||||
ONLY_FETCH_ONCE
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue