mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2026-03-27 05:49:12 -06:00
Fix 3DSX being treated as invalid applications
This commit is contained in:
parent
32da5ea0ae
commit
30779d35cd
@ -136,7 +136,7 @@ class GameAdapter(
|
||||
val holder = view.tag as GameViewHolder
|
||||
gameExists(holder)
|
||||
|
||||
if (holder.game.titleId == 0L) {
|
||||
if (!holder.game.valid) {
|
||||
MaterialAlertDialogBuilder(context)
|
||||
.setTitle(R.string.properties)
|
||||
.setMessage(R.string.properties_not_loaded)
|
||||
@ -558,7 +558,9 @@ class GameAdapter(
|
||||
|
||||
private class DiffCallback : DiffUtil.ItemCallback<Game>() {
|
||||
override fun areItemsTheSame(oldItem: Game, newItem: Game): Boolean {
|
||||
return oldItem.titleId == newItem.titleId
|
||||
// The title is taken into account to support 3DSX, which all have the titleID 0.
|
||||
// This only works now because we always return the English title, adjust if that changes.
|
||||
return oldItem.titleId == newItem.titleId && oldItem.title == newItem.title
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItem: Game, newItem: Game): Boolean {
|
||||
|
||||
@ -16,6 +16,7 @@ import org.citra.citra_emu.activities.EmulationActivity
|
||||
@Parcelize
|
||||
@Serializable
|
||||
class Game(
|
||||
val valid: Boolean = false,
|
||||
val title: String = "",
|
||||
val description: String = "",
|
||||
val path: String = "",
|
||||
|
||||
@ -79,14 +79,15 @@ object GameHelper {
|
||||
gameInfo = GameInfo(nativePath)
|
||||
}
|
||||
|
||||
|
||||
if (gameInfo?.isValid() == false) {
|
||||
val valid = gameInfo.isValid()
|
||||
if (!valid) {
|
||||
gameInfo = null
|
||||
}
|
||||
|
||||
val isEncrypted = gameInfo?.isEncrypted() == true
|
||||
|
||||
val newGame = Game(
|
||||
valid,
|
||||
(gameInfo?.getTitle() ?: FileUtil.getFilename(uri)).replace("[\\t\\n\\r]+".toRegex(), " "),
|
||||
filePath.replace("\n", " "),
|
||||
if (BuildUtil.isGooglePlayBuild || FileUtil.isNativePath(filePath)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user