mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 15:30:31 +05:30
Merge pull request #7244 from FineFindus/fix/local-channel-continuations
fix(Local): encode nextpage data as base64
This commit is contained in:
commit
1a8ab788a0
@ -1,5 +1,6 @@
|
||||
package com.github.libretube.api
|
||||
|
||||
import android.util.Base64
|
||||
import com.github.libretube.api.obj.Channel
|
||||
import com.github.libretube.api.obj.ChannelTab
|
||||
import com.github.libretube.api.obj.ChannelTabResponse
|
||||
@ -210,11 +211,11 @@ private data class NextPage(
|
||||
)
|
||||
|
||||
fun Page.toNextPageString() = JsonHelper.json.encodeToString(
|
||||
NextPage(url, id, ids, cookies, body?.toString())
|
||||
NextPage(url, id, ids, cookies, body?.let { Base64.encodeToString(it, Base64.DEFAULT) })
|
||||
)
|
||||
|
||||
fun String.toPage(): Page = with(JsonHelper.json.decodeFromString<NextPage>(this)) {
|
||||
return Page(url, id, ids, cookies, body?.toByteArray())
|
||||
return Page(url, id, ids, cookies, body?.let { Base64.decode(it, Base64.DEFAULT) })
|
||||
}
|
||||
|
||||
@Serializable
|
||||
|
Loading…
x
Reference in New Issue
Block a user