Compare commits

..

1 Commits

Author SHA1 Message Date
RowdyRushya d89a8bb0ae
Merge aa522c8052 into 004c481a5e 2024-04-27 22:02:27 +05:30
1 changed files with 1 additions and 2 deletions

View File

@ -1099,14 +1099,13 @@ class ResultViewModel2 : ViewModel() {
val duplicateEntries = data.filter { it: DataStoreHelper.LibrarySearchResponse ->
val librarySyncData = it.syncData
val yearCheck = year == it.year || year == null || it.year == null
val checks = listOf(
{ imdbId != null && getImdbIdFromSyncData(librarySyncData) == imdbId },
{ tmdbId != null && getTMDbIdFromSyncData(librarySyncData) == tmdbId },
{ malId != null && librarySyncData?.get(AccountManager.malApi.idPrefix) == malId },
{ aniListId != null && librarySyncData?.get(AccountManager.aniListApi.idPrefix) == aniListId },
{ normalizedName == normalizeString(it.name) && yearCheck }
{ normalizedName == normalizeString(it.name) && year == it.year }
)
checks.any { it() }