mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 22:37:56 +01:00 
			
		
		
		
	refactor: remove getInstant and decodeSyncBackup
Not used anymore. Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
		| @@ -33,17 +33,6 @@ abstract class SyncService( | ||||
|         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 | ||||
|      */ | ||||
| @@ -81,9 +70,7 @@ abstract class SyncService( | ||||
|  | ||||
|         // Create the merged SData object | ||||
|         return SyncData( | ||||
|             sync = localSyncData.sync, // always use the local sync info | ||||
|             backup = mergedBackup, | ||||
|             device = localSyncData.device, // always use the local device info | ||||
|         ) | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,5 @@ | ||||
| package tachiyomi.core.preference | ||||
|  | ||||
| import java.time.Instant | ||||
|  | ||||
| interface PreferenceStore { | ||||
|  | ||||
|     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 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( | ||||
|         key: String, | ||||
|         defaultValue: T, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user