mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Prioritize finding selected chapter when deduping reader chapters
Fixes #9054
This commit is contained in:
		@@ -177,10 +177,11 @@ class ReaderViewModel(
 | 
			
		||||
        }.run {
 | 
			
		||||
            if (readerPreferences.skipDupe().get()) {
 | 
			
		||||
                groupBy { it.chapterNumber }
 | 
			
		||||
                    .mapValues { (_, chapters) ->
 | 
			
		||||
                        chapters.find { it.id == chapterId || it.scanlator == selectedChapter.scanlator } ?: chapters.first()
 | 
			
		||||
                    .map { (_, chapters) ->
 | 
			
		||||
                        chapters.find { it.id == selectedChapter.id }
 | 
			
		||||
                            ?: chapters.find { it.scanlator == selectedChapter.scanlator }
 | 
			
		||||
                            ?: chapters.first()
 | 
			
		||||
                    }
 | 
			
		||||
                    .values
 | 
			
		||||
            } else {
 | 
			
		||||
                this
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user