mirror of
https://github.com/meowarex/rl-mobile.git
synced 2026-06-18 05:23:12 +10:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c81d2edba3 | |||
| 9180129afc |
@@ -117,18 +117,22 @@ class HomeModel(
|
|||||||
|
|
||||||
val remote = remoteDataJson
|
val remote = remoteDataJson
|
||||||
val currentPatches = remote?.patchesVersion?.toString()
|
val currentPatches = remote?.patchesVersion?.toString()
|
||||||
|
val installedPatches = installMetadata?.patchesVersion?.toString()
|
||||||
val previousPatches = initialPrefPatchesVersion.ifEmpty {
|
val previousPatches = initialPrefPatchesVersion.ifEmpty {
|
||||||
installMetadata?.patchesVersion?.toString().orEmpty()
|
installedPatches.orEmpty()
|
||||||
}
|
}
|
||||||
val patchesFrom = previousPatches.takeIf { it.isNotEmpty() }
|
val patchesFrom = previousPatches.takeIf { it.isNotEmpty() }
|
||||||
val patchesTo = currentPatches ?: previousPatches.ifEmpty { "?" }
|
val patchesTo = currentPatches ?: previousPatches.ifEmpty { "?" }
|
||||||
|
val patchesUpdateAvailable = installedPatches != null
|
||||||
|
&& currentPatches != null
|
||||||
|
&& installedPatches != currentPatches
|
||||||
add(
|
add(
|
||||||
VersionDelta(
|
VersionDelta(
|
||||||
label = application.getString(R.string.manager_update_row_patches),
|
label = application.getString(R.string.manager_update_row_patches),
|
||||||
iconRes = R.drawable.ic_extension,
|
iconRes = R.drawable.ic_extension,
|
||||||
from = patchesFrom,
|
from = patchesFrom,
|
||||||
to = patchesTo,
|
to = patchesTo,
|
||||||
tag = if (patchesFrom != null && patchesFrom != patchesTo)
|
tag = if (patchesUpdateAvailable)
|
||||||
application.getString(R.string.manager_update_tag_available) else null,
|
application.getString(R.string.manager_update_tag_available) else null,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -142,13 +146,16 @@ class HomeModel(
|
|||||||
val tidalTo = currentTidal?.toString()
|
val tidalTo = currentTidal?.toString()
|
||||||
?: previousTidal.takeIf { it > 0 }?.toString()
|
?: previousTidal.takeIf { it > 0 }?.toString()
|
||||||
?: "?"
|
?: "?"
|
||||||
|
val tidalUpdateAvailable = installedTidalVersionCode > 0
|
||||||
|
&& currentTidal != null
|
||||||
|
&& installedTidalVersionCode != currentTidal
|
||||||
add(
|
add(
|
||||||
VersionDelta(
|
VersionDelta(
|
||||||
label = application.getString(R.string.manager_update_row_tidal),
|
label = application.getString(R.string.manager_update_row_tidal),
|
||||||
iconRes = R.drawable.ic_music_note,
|
iconRes = R.drawable.ic_music_note,
|
||||||
from = tidalFrom,
|
from = tidalFrom,
|
||||||
to = tidalTo,
|
to = tidalTo,
|
||||||
tag = if (tidalFrom != null && tidalFrom != tidalTo)
|
tag = if (tidalUpdateAvailable)
|
||||||
application.getString(R.string.manager_update_tag_available) else null,
|
application.getString(R.string.manager_update_tag_available) else null,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -208,7 +208,9 @@ private fun ColumnScope.HomeContent(
|
|||||||
val label = when {
|
val label = when {
|
||||||
state.latestTidalVersionCode == null -> "Loading…"
|
state.latestTidalVersionCode == null -> "Loading…"
|
||||||
install == null -> "Install"
|
install == null -> "Install"
|
||||||
install.isUpToDate == false -> "Update"
|
patchesBehind && tidalBehind -> "Update Patches & TIDAL"
|
||||||
|
patchesBehind -> "Update Patches"
|
||||||
|
tidalBehind -> "Update TIDAL"
|
||||||
else -> "Repatch"
|
else -> "Repatch"
|
||||||
}
|
}
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
Reference in New Issue
Block a user