mirror of
				https://github.com/recloudstream/cloudstream.git
				synced 2024-08-15 01:53:11 +00:00 
			
		
		
		
	Don't check year when checking duplicates if year is empty
Some sources don't use year which makes this not match when it really should match
This commit is contained in:
		
							parent
							
								
									004c481a5e
								
							
						
					
					
						commit
						beaf6b5c97
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -1099,13 +1099,14 @@ 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) && year == it.year } | ||||
|                 { normalizedName == normalizeString(it.name) && yearCheck } | ||||
|             ) | ||||
| 
 | ||||
|             checks.any { it() } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue