refactor: remove getInstant and decodeSyncBackup

Not used anymore.

Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
KaiserBh 2023-11-14 17:41:10 +11:00
parent 7ef188e23a
commit 19227d6c5b
No known key found for this signature in database
GPG Key ID: 14D73B142042BBA9
2 changed files with 0 additions and 24 deletions

View File

@ -33,17 +33,6 @@ abstract class SyncService(
return finalSyncData.backup return finalSyncData.backup
} }
/**
* Decodes the given sync data string into a Backup object.
*
* @param data The sync data string to be decoded.
* @return The decoded Backup object.
*/
protected fun decodeSyncBackup(data: String): Backup {
val syncData = json.decodeFromString(SyncData.serializer(), data)
return syncData.backup!!
}
/** /**
* For refreshing tokens and other possible operations before connecting to the remote storage * For refreshing tokens and other possible operations before connecting to the remote storage
*/ */
@ -81,9 +70,7 @@ abstract class SyncService(
// Create the merged SData object // Create the merged SData object
return SyncData( return SyncData(
sync = localSyncData.sync, // always use the local sync info
backup = mergedBackup, backup = mergedBackup,
device = localSyncData.device, // always use the local device info
) )
} }

View File

@ -1,7 +1,5 @@
package tachiyomi.core.preference package tachiyomi.core.preference
import java.time.Instant
interface PreferenceStore { interface PreferenceStore {
fun getString(key: String, defaultValue: String = ""): Preference<String> fun getString(key: String, defaultValue: String = ""): Preference<String>
@ -16,15 +14,6 @@ interface PreferenceStore {
fun getStringSet(key: String, defaultValue: Set<String> = emptySet()): Preference<Set<String>> fun getStringSet(key: String, defaultValue: Set<String> = emptySet()): Preference<Set<String>>
fun getInstant(key: String, defaultValue: Instant = Instant.EPOCH): Preference<Instant> {
return getObject(
key = key,
defaultValue = defaultValue,
serializer = { it.epochSecond.toString() },
deserializer = { Instant.ofEpochSecond(it.toLong()) },
)
}
fun <T> getObject( fun <T> getObject(
key: String, key: String,
defaultValue: T, defaultValue: T,