forked from MeloNX/MeloNX
Fix game model uniqueness
This commit is contained in:
parent
2d1a357d1b
commit
37908e8c3b
@ -9,7 +9,7 @@ import SwiftUI
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
public struct Game: Identifiable, Equatable, Hashable {
|
||||
public var id: String { titleId }
|
||||
public var id: URL { fileURL }
|
||||
|
||||
var containerFolder: URL
|
||||
var fileType: UTType
|
||||
|
@ -40,7 +40,7 @@ struct GameLibraryView: View {
|
||||
var filteredGames: [Game] {
|
||||
if searchText.isEmpty {
|
||||
return Ryujinx.shared.games.filter { game in
|
||||
!realRecentGames.contains(where: { $0.titleId == game.titleId })
|
||||
!realRecentGames.contains(where: { $0.fileURL == game.fileURL })
|
||||
}
|
||||
}
|
||||
return Ryujinx.shared.games.filter {
|
||||
@ -52,7 +52,7 @@ struct GameLibraryView: View {
|
||||
var realRecentGames: [Game] {
|
||||
let games = Ryujinx.shared.games
|
||||
return recentGames.compactMap { recentGame in
|
||||
games.first(where: { $0.titleId == recentGame.titleId })
|
||||
games.first(where: { $0.fileURL == recentGame.fileURL })
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user