feat: toggle for icon in rpc

This commit is contained in:
aayush262
2024-04-10 14:05:24 +05:30
parent c242d9dd99
commit 5e5277404e
7 changed files with 27 additions and 6 deletions

View File

@@ -71,4 +71,6 @@ object Discord {
const val application_Id = "1163925779692912771"
const val small_Image: String =
"mp:external/GJEe4hKzr8w56IW6ZKQz43HFVEo8pOtA_C-dJiWwxKo/https/cdn.discordapp.com/app-icons/1163925779692912771/f6b42d41dfdf0b56fcc79d4a12d2ac66.png"
const val small_Image_AniList: String =
"mp:external/rHOIjjChluqQtGyL_UHk6Z4oAqiVYlo_B7HSGPLSoUg/%3Fsize%3D128/https/cdn.discordapp.com/icons/210521487378087947/a_f54f910e2add364a3da3bb2f2fce0c72.webp"
}

View File

@@ -71,8 +71,8 @@ open class RPC(val token: String, val coroutineContext: CoroutineContext) {
assets = Activity.Assets(
largeImage = data.largeImage?.url?.discordUrl(),
largeText = data.largeImage?.label,
smallImage = data.smallImage?.url?.discordUrl(),
smallText = data.smallImage?.label
smallImage = if (PrefManager.getVal(PrefName.ShowIcon)) Discord.small_Image_AniList.discordUrl() else Discord.small_Image.discordUrl(),
smallText = if (PrefManager.getVal(PrefName.ShowIcon)) "Anilist" else "Dantotsu",
),
buttons = data.buttons.map { it.label },
metadata = Activity.Metadata(