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.
(cherry picked from commit ba533f30ce)
# Conflicts:
# app/src/main/java/eu/kanade/data/DatabaseAdapter.kt
# app/src/main/java/eu/kanade/data/manga/MangaMapper.kt
# app/src/main/java/eu/kanade/data/manga/MangaRepositoryImpl.kt
# app/src/main/java/eu/kanade/tachiyomi/AppModule.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt
# app/src/main/java/eu/kanade/tachiyomi/data/backup/models/BackupManga.kt
# app/src/main/java/eu/kanade/tachiyomi/data/database/models/MangaImpl.kt
# app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
# app/src/main/sqldelight/data/mangas.sq
# app/src/main/sqldelight/migrations/20.sqm
This commit is contained in:
committed by
Jobobby04
parent
3da5a2a20d
commit
2d2ee54c99
@@ -20,6 +20,8 @@ interface SManga : Serializable {
|
||||
|
||||
var thumbnail_url: String?
|
||||
|
||||
var update_strategy: UpdateStrategy
|
||||
|
||||
var initialized: Boolean
|
||||
|
||||
fun getGenres(): List<String>? {
|
||||
@@ -65,6 +67,8 @@ interface SManga : Serializable {
|
||||
|
||||
status = other.status
|
||||
|
||||
update_strategy = other.update_strategy
|
||||
|
||||
if (!initialized) {
|
||||
initialized = other.initialized
|
||||
}
|
||||
@@ -81,6 +85,7 @@ interface SManga : Serializable {
|
||||
it.status = originalStatus
|
||||
// SY <--
|
||||
it.thumbnail_url = thumbnail_url
|
||||
it.update_strategy = update_strategy
|
||||
it.initialized = initialized
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ class SMangaImpl : SManga {
|
||||
|
||||
override var thumbnail_url: String? = null
|
||||
|
||||
override var update_strategy: UpdateStrategy = UpdateStrategy.ALWAYS_UPDATE
|
||||
|
||||
override var initialized: Boolean = false
|
||||
|
||||
// SY -->
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user