mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-24 20:18:53 +02:00
Split sync feature part 1
Co-authored-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
@@ -13,6 +13,7 @@ data class Chapter(
|
||||
val dateUpload: Long,
|
||||
val chapterNumber: Float,
|
||||
val scanlator: String?,
|
||||
val lastModifiedAt: Long?,
|
||||
) {
|
||||
val isRecognizedNumber: Boolean
|
||||
get() = chapterNumber >= 0f
|
||||
@@ -31,6 +32,7 @@ data class Chapter(
|
||||
dateUpload = -1,
|
||||
chapterNumber = -1f,
|
||||
scanlator = null,
|
||||
lastModifiedAt = null,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ data class Manga(
|
||||
val thumbnailUrl: String?,
|
||||
val updateStrategy: UpdateStrategy,
|
||||
val initialized: Boolean,
|
||||
val lastModifiedAt: Long?,
|
||||
) : Serializable {
|
||||
|
||||
val sorting: Long
|
||||
@@ -109,6 +110,7 @@ data class Manga(
|
||||
thumbnailUrl = null,
|
||||
updateStrategy = UpdateStrategy.ALWAYS_UPDATE,
|
||||
initialized = false,
|
||||
lastModifiedAt = 0L,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package tachiyomi.domain.sync
|
||||
|
||||
import tachiyomi.core.preference.PreferenceStore
|
||||
import java.time.Instant
|
||||
|
||||
class SyncPreferences(
|
||||
private val preferenceStore: PreferenceStore,
|
||||
) {
|
||||
fun syncHost() = preferenceStore.getString("sync_host", "https://sync.tachiyomi.org")
|
||||
fun syncAPIKey() = preferenceStore.getString("sync_api_key", "")
|
||||
fun syncLastSync() = preferenceStore.getInstant("sync_last_sync", Instant.EPOCH)
|
||||
|
||||
fun syncInterval() = preferenceStore.getInt("sync_interval", 0)
|
||||
|
||||
fun deviceName() = preferenceStore.getString("device_name", android.os.Build.MANUFACTURER + android.os.Build.PRODUCT)
|
||||
|
||||
fun deviceID() = preferenceStore.getInt("device_id", 0)
|
||||
|
||||
fun syncService() = preferenceStore.getInt("sync_service", 0)
|
||||
}
|
||||
Reference in New Issue
Block a user