mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Stop filtering out all categories that have a year in it
As a fix for #750, a validation was added to filter out categories that were of form "... taken on ... 1990" or "... needing ... 2005". The conditional added for the fix was a bit loose than it should be as a result of which it filtered out all categories that had a year in its name. This is incorrect. Fix this by tigheting the conditional so that only categories that have a year, is not the present or previous year AND (contains "taken on" OR "needing") is filtered out. While doing so, turn an implicit precedence into an explicit one.
This commit is contained in:
		
							parent
							
								
									1078c70525
								
							
						
					
					
						commit
						9a1d3efe75
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -42,10 +42,10 @@ class CategoriesModel @Inject constructor( | |||
|         return item.matches(".*(19|20)\\d{2}.*".toRegex()) | ||||
|                 && !item.contains(yearInString) | ||||
|                 && !item.contains(prevYearInString) | ||||
|                 || item.matches("(.*)needing(.*)".toRegex()) | ||||
|                 || item.matches("(.*)taken on(.*)".toRegex()) | ||||
|                 || item.matches(".*0s.*".toRegex()) | ||||
|                 && !item.matches(".*(200|201)0s.*".toRegex()) | ||||
|                 && (item.matches("(.*)needing(.*)".toRegex()) | ||||
|                     || item.matches("(.*)taken on(.*)".toRegex())) | ||||
|                 || (item.matches(".*0s.*".toRegex()) | ||||
|                     && !item.matches(".*(200|201)0s.*".toRegex())) | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kaartic Sivaraam
						Kaartic Sivaraam