mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-22 17:52:06 +00:00
ref: progress key generation for rpc sync
This commit is contained in:
parent
044a125694
commit
938d33eb75
1 changed files with 8 additions and 0 deletions
|
|
@ -50,6 +50,7 @@ object SupabaseProgressSyncAdapter : ProgressSyncAdapter {
|
|||
position = entry.lastPositionMs,
|
||||
duration = entry.durationMs,
|
||||
lastWatched = entry.lastUpdatedEpochMs,
|
||||
progressKey = progressKeyForEntry(entry),
|
||||
)
|
||||
}
|
||||
val params = buildJsonObject {
|
||||
|
|
@ -76,6 +77,13 @@ object SupabaseProgressSyncAdapter : ProgressSyncAdapter {
|
|||
}
|
||||
SupabaseProvider.client.postgrest.rpc("sync_delete_watch_progress", params)
|
||||
}
|
||||
|
||||
private fun progressKeyForEntry(entry: WatchProgressEntry): String =
|
||||
if (entry.seasonNumber != null && entry.episodeNumber != null) {
|
||||
"${entry.parentMetaId}_s${entry.seasonNumber}e${entry.episodeNumber}"
|
||||
} else {
|
||||
entry.parentMetaId
|
||||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
|
|
|
|||
Loading…
Reference in a new issue