mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	Move isLocal extension functions to LocalSource
This commit is contained in:
		@@ -8,7 +8,7 @@ import tachiyomi.domain.source.model.Pin
 | 
			
		||||
import tachiyomi.domain.source.model.Pins
 | 
			
		||||
import tachiyomi.domain.source.model.Source
 | 
			
		||||
import tachiyomi.domain.source.repository.SourceRepository
 | 
			
		||||
import tachiyomi.source.local.LocalSource
 | 
			
		||||
import tachiyomi.source.local.isLocal
 | 
			
		||||
 | 
			
		||||
class GetEnabledSources(
 | 
			
		||||
    private val repository: SourceRepository,
 | 
			
		||||
@@ -24,7 +24,7 @@ class GetEnabledSources(
 | 
			
		||||
            repository.getSources(),
 | 
			
		||||
        ) { pinnedSourceIds, enabledLanguages, disabledSources, lastUsedSource, sources ->
 | 
			
		||||
            sources
 | 
			
		||||
                .filter { it.lang in enabledLanguages || it.id == LocalSource.ID }
 | 
			
		||||
                .filter { it.lang in enabledLanguages || it.isLocal() }
 | 
			
		||||
                .filterNot { it.id.toString() in disabledSources }
 | 
			
		||||
                .sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.name })
 | 
			
		||||
                .flatMap {
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ import kotlinx.coroutines.flow.Flow
 | 
			
		||||
import kotlinx.coroutines.flow.combine
 | 
			
		||||
import tachiyomi.domain.source.model.Source
 | 
			
		||||
import tachiyomi.domain.source.repository.SourceRepository
 | 
			
		||||
import tachiyomi.source.local.LocalSource
 | 
			
		||||
import tachiyomi.source.local.isLocal
 | 
			
		||||
import java.text.Collator
 | 
			
		||||
import java.util.Collections
 | 
			
		||||
import java.util.Locale
 | 
			
		||||
@@ -22,7 +22,7 @@ class GetSourcesWithFavoriteCount(
 | 
			
		||||
            repository.getSourcesWithFavoriteCount(),
 | 
			
		||||
        ) { direction, mode, list ->
 | 
			
		||||
            list
 | 
			
		||||
                .filterNot { it.first.id == LocalSource.ID }
 | 
			
		||||
                .filterNot { it.first.isLocal() }
 | 
			
		||||
                .sortedWith(sortFn(direction, mode))
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user