diff --git a/app/shared/app-data/src/commonMain/kotlin/data/persistent/SettingsStore.kt b/app/shared/app-data/src/commonMain/kotlin/data/persistent/SettingsStore.kt index cb0c69952b..3585b82552 100644 --- a/app/shared/app-data/src/commonMain/kotlin/data/persistent/SettingsStore.kt +++ b/app/shared/app-data/src/commonMain/kotlin/data/persistent/SettingsStore.kt @@ -48,10 +48,10 @@ abstract class PlatformDataStoreManager { val mediaSourceSubscriptionStore by lazy { DataStoreFactory.create( serializer = MediaSourceSubscriptionsSaveData.serializer() - .asDataStoreSerializer({ MediaSourceSubscriptionsSaveData.Empty }), + .asDataStoreSerializer({ MediaSourceSubscriptionsSaveData.Default }), produceFile = { resolveDataStoreFile("mediaSourceSubscription") }, corruptionHandler = ReplaceFileCorruptionHandler { - MediaSourceSubscriptionsSaveData.Empty + MediaSourceSubscriptionsSaveData.Default }, ) } diff --git a/app/shared/app-data/src/commonMain/kotlin/data/repository/MediaSourceSubscriptionRepository.kt b/app/shared/app-data/src/commonMain/kotlin/data/repository/MediaSourceSubscriptionRepository.kt index 906bc60573..816b1ae7dd 100644 --- a/app/shared/app-data/src/commonMain/kotlin/data/repository/MediaSourceSubscriptionRepository.kt +++ b/app/shared/app-data/src/commonMain/kotlin/data/repository/MediaSourceSubscriptionRepository.kt @@ -13,6 +13,7 @@ import androidx.datastore.core.DataStore import kotlinx.coroutines.flow.map import kotlinx.serialization.Serializable import me.him188.ani.app.data.source.media.source.subscription.MediaSourceSubscription +import me.him188.ani.utils.platform.Uuid class MediaSourceSubscriptionRepository( private val dataStore: DataStore, @@ -62,6 +63,13 @@ data class MediaSourceSubscriptionsSaveData( val list: List ) { companion object { - val Empty = MediaSourceSubscriptionsSaveData(emptyList()) + val Default = MediaSourceSubscriptionsSaveData( + listOf( + MediaSourceSubscription( + subscriptionId = Uuid.randomString(), + url = "https://sub.creamycake.org/sub1.json", + ), + ), + ) } }