diff --git a/.editorconfig b/.editorconfig
index d1f195728..fc6b3c0c8 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,7 +1,8 @@
[*.{kt,kts}]
-indent_size=4
-insert_final_newline=true
-ij_kotlin_allow_trailing_comma=true
-ij_kotlin_allow_trailing_comma_on_call_site=true
-ij_kotlin_name_count_to_use_star_import=2147483647
-ij_kotlin_name_count_to_use_star_import_for_members=2147483647
+max_line_length = 120
+indent_size = 4
+insert_final_newline = true
+ij_kotlin_allow_trailing_comma = true
+ij_kotlin_allow_trailing_comma_on_call_site = true
+ij_kotlin_name_count_to_use_star_import = 2147483647
+ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index 3e311f12f..d1df7597c 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -3,7 +3,7 @@
I acknowledge that:
- I have updated:
- - To the latest version of the app (stable is v0.14.6)
+ - To the latest version of the app (stable is v0.14.7)
- All extensions
- I have gone through the FAQ (https://tachiyomi.org/docs/faq/general) and troubleshooting guide (https://tachiyomi.org/docs/guides/troubleshooting/)
- If this is an issue with an extension, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi-extensions
diff --git a/.github/ISSUE_TEMPLATE/report_issue.yml b/.github/ISSUE_TEMPLATE/report_issue.yml
index e80993914..5e4d244d9 100644
--- a/.github/ISSUE_TEMPLATE/report_issue.yml
+++ b/.github/ISSUE_TEMPLATE/report_issue.yml
@@ -53,7 +53,7 @@ body:
label: Tachiyomi version
description: You can find your Tachiyomi version in **More → About**.
placeholder: |
- Example: "0.14.6"
+ Example: "0.14.7"
validations:
required: true
@@ -98,7 +98,7 @@ body:
required: true
- label: I have gone through the [FAQ](https://tachiyomi.org/docs/faq/general) and [troubleshooting guide](https://tachiyomi.org/docs/guides/troubleshooting/).
required: true
- - label: I have updated the app to version **[0.14.6](https://github.com/tachiyomiorg/tachiyomi/releases/latest)**.
+ - label: I have updated the app to version **[0.14.7](https://github.com/tachiyomiorg/tachiyomi/releases/latest)**.
required: true
- label: I have updated all installed extensions.
required: true
diff --git a/.github/ISSUE_TEMPLATE/request_feature.yml b/.github/ISSUE_TEMPLATE/request_feature.yml
index af59d3565..b5f8296c0 100644
--- a/.github/ISSUE_TEMPLATE/request_feature.yml
+++ b/.github/ISSUE_TEMPLATE/request_feature.yml
@@ -33,7 +33,7 @@ body:
required: true
- label: If this is an issue with an extension, I should be opening an issue in the [extensions repository](https://github.com/tachiyomiorg/tachiyomi-extensions/issues/new/choose).
required: true
- - label: I have updated the app to version **[0.14.6](https://github.com/tachiyomiorg/tachiyomi/releases/latest)**.
+ - label: I have updated the app to version **[0.14.7](https://github.com/tachiyomiorg/tachiyomi/releases/latest)**.
required: true
- label: I will fill out all of the requested information in this form.
required: true
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 10c1d11c9..2735a8f71 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -22,8 +22,8 @@ android {
defaultConfig {
applicationId = "eu.kanade.tachiyomi"
- versionCode = 107
- versionName = "0.14.6"
+ versionCode = 109
+ versionName = "0.14.7"
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
@@ -304,12 +304,12 @@ tasks {
kotlinOptions.freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
- project.buildDir.absolutePath + "/compose_metrics",
+ project.layout.buildDirectory.dir("compose_metrics").get().asFile.absolutePath,
)
kotlinOptions.freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
- project.buildDir.absolutePath + "/compose_metrics",
+ project.layout.buildDirectory.dir("compose_metrics").get().asFile.absolutePath,
)
}
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 424952c7d..f6cc6ed32 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -159,10 +159,6 @@
android:name=".data.download.DownloadService"
android:exported="false" />
-
-
diff --git a/app/src/main/java/eu/kanade/domain/DomainModule.kt b/app/src/main/java/eu/kanade/domain/DomainModule.kt
index 8559cd923..778b7645c 100644
--- a/app/src/main/java/eu/kanade/domain/DomainModule.kt
+++ b/app/src/main/java/eu/kanade/domain/DomainModule.kt
@@ -1,11 +1,14 @@
package eu.kanade.domain
+import eu.kanade.domain.chapter.interactor.GetAvailableScanlators
import eu.kanade.domain.chapter.interactor.SetReadStatus
import eu.kanade.domain.chapter.interactor.SyncChaptersWithSource
import eu.kanade.domain.download.interactor.DeleteDownload
import eu.kanade.domain.extension.interactor.GetExtensionLanguages
import eu.kanade.domain.extension.interactor.GetExtensionSources
import eu.kanade.domain.extension.interactor.GetExtensionsByType
+import eu.kanade.domain.manga.interactor.GetExcludedScanlators
+import eu.kanade.domain.manga.interactor.SetExcludedScanlators
import eu.kanade.domain.manga.interactor.SetMangaViewerFlags
import eu.kanade.domain.manga.interactor.UpdateManga
import eu.kanade.domain.source.interactor.GetEnabledSources
@@ -40,8 +43,8 @@ import tachiyomi.domain.category.interactor.SetSortModeForCategory
import tachiyomi.domain.category.interactor.UpdateCategory
import tachiyomi.domain.category.repository.CategoryRepository
import tachiyomi.domain.chapter.interactor.GetChapter
-import tachiyomi.domain.chapter.interactor.GetChapterByMangaId
import tachiyomi.domain.chapter.interactor.GetChapterByUrlAndMangaId
+import tachiyomi.domain.chapter.interactor.GetChaptersByMangaId
import tachiyomi.domain.chapter.interactor.SetMangaDefaultChapterFlags
import tachiyomi.domain.chapter.interactor.ShouldUpdateDbChapter
import tachiyomi.domain.chapter.interactor.UpdateChapter
@@ -112,13 +115,15 @@ class DomainModule : InjektModule {
addFactory { NetworkToLocalManga(get()) }
addFactory { UpdateManga(get(), get()) }
addFactory { SetMangaCategories(get()) }
+ addFactory { GetExcludedScanlators(get()) }
+ addFactory { SetExcludedScanlators(get()) }
addSingletonFactory { ReleaseServiceImpl(get(), get()) }
addFactory { GetApplicationRelease(get(), get()) }
addSingletonFactory { TrackRepositoryImpl(get()) }
addFactory { TrackChapter(get(), get(), get(), get()) }
- addFactory { AddTracks(get(), get(), get()) }
+ addFactory { AddTracks(get(), get(), get(), get()) }
addFactory { RefreshTracks(get(), get(), get(), get()) }
addFactory { DeleteTrack(get()) }
addFactory { GetTracksPerManga(get()) }
@@ -128,12 +133,13 @@ class DomainModule : InjektModule {
addSingletonFactory { ChapterRepositoryImpl(get()) }
addFactory { GetChapter(get()) }
- addFactory { GetChapterByMangaId(get()) }
+ addFactory { GetChaptersByMangaId(get()) }
addFactory { GetChapterByUrlAndMangaId(get()) }
addFactory { UpdateChapter(get()) }
addFactory { SetReadStatus(get(), get(), get(), get()) }
addFactory { ShouldUpdateDbChapter() }
- addFactory { SyncChaptersWithSource(get(), get(), get(), get(), get(), get(), get()) }
+ addFactory { SyncChaptersWithSource(get(), get(), get(), get(), get(), get(), get(), get()) }
+ addFactory { GetAvailableScanlators(get()) }
addSingletonFactory { HistoryRepositoryImpl(get()) }
addFactory { GetHistory(get()) }
diff --git a/app/src/main/java/eu/kanade/domain/base/BasePreferences.kt b/app/src/main/java/eu/kanade/domain/base/BasePreferences.kt
index 34ef79b48..0acef84a9 100644
--- a/app/src/main/java/eu/kanade/domain/base/BasePreferences.kt
+++ b/app/src/main/java/eu/kanade/domain/base/BasePreferences.kt
@@ -5,6 +5,7 @@ import androidx.annotation.StringRes
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.system.isPreviewBuildType
import eu.kanade.tachiyomi.util.system.isReleaseBuildType
+import tachiyomi.core.preference.Preference
import tachiyomi.core.preference.PreferenceStore
class BasePreferences(
@@ -12,9 +13,12 @@ class BasePreferences(
private val preferenceStore: PreferenceStore,
) {
- fun downloadedOnly() = preferenceStore.getBoolean("pref_downloaded_only", false)
+ fun downloadedOnly() = preferenceStore.getBoolean(
+ Preference.appStateKey("pref_downloaded_only"),
+ false,
+ )
- fun incognitoMode() = preferenceStore.getBoolean("incognito_mode", false)
+ fun incognitoMode() = preferenceStore.getBoolean(Preference.appStateKey("incognito_mode"), false)
fun extensionInstaller() = ExtensionInstallerPreference(context, preferenceStore)
diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/GetAvailableScanlators.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/GetAvailableScanlators.kt
new file mode 100644
index 000000000..13bd35e1f
--- /dev/null
+++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/GetAvailableScanlators.kt
@@ -0,0 +1,24 @@
+package eu.kanade.domain.chapter.interactor
+
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.map
+import tachiyomi.domain.chapter.repository.ChapterRepository
+
+class GetAvailableScanlators(
+ private val repository: ChapterRepository,
+) {
+
+ private fun List.cleanupAvailableScanlators(): Set {
+ return mapNotNull { it.ifBlank { null } }.toSet()
+ }
+
+ suspend fun await(mangaId: Long): Set {
+ return repository.getScanlatorsByMangaId(mangaId)
+ .cleanupAvailableScanlators()
+ }
+
+ fun subscribe(mangaId: Long): Flow> {
+ return repository.getScanlatorsByMangaIdAsFlow(mangaId)
+ .map { it.cleanupAvailableScanlators() }
+ }
+}
diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt
index 6205ea365..1690180b2 100644
--- a/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt
+++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt
@@ -2,6 +2,7 @@ package eu.kanade.domain.chapter.interactor
import eu.kanade.domain.chapter.model.copyFromSChapter
import eu.kanade.domain.chapter.model.toSChapter
+import eu.kanade.domain.manga.interactor.GetExcludedScanlators
import eu.kanade.domain.manga.interactor.UpdateManga
import eu.kanade.domain.manga.model.toSManga
import eu.kanade.tachiyomi.data.download.DownloadManager
@@ -10,7 +11,7 @@ import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.online.HttpSource
import tachiyomi.data.chapter.ChapterSanitizer
-import tachiyomi.domain.chapter.interactor.GetChapterByMangaId
+import tachiyomi.domain.chapter.interactor.GetChaptersByMangaId
import tachiyomi.domain.chapter.interactor.ShouldUpdateDbChapter
import tachiyomi.domain.chapter.interactor.UpdateChapter
import tachiyomi.domain.chapter.model.Chapter
@@ -32,7 +33,8 @@ class SyncChaptersWithSource(
private val shouldUpdateDbChapter: ShouldUpdateDbChapter,
private val updateManga: UpdateManga,
private val updateChapter: UpdateChapter,
- private val getChapterByMangaId: GetChapterByMangaId,
+ private val getChaptersByMangaId: GetChaptersByMangaId,
+ private val getExcludedScanlators: GetExcludedScanlators,
) {
/**
@@ -66,7 +68,7 @@ class SyncChaptersWithSource(
}
// Chapters from db.
- val dbChapters = getChapterByMangaId.await(manga.id)
+ val dbChapters = getChaptersByMangaId.await(manga.id)
// Chapters from the source not in db.
val toAdd = mutableListOf()
@@ -116,7 +118,9 @@ class SyncChaptersWithSource(
} else {
if (shouldUpdateDbChapter.await(dbChapter, chapter)) {
val shouldRenameChapter = downloadProvider.isChapterDirNameChanged(dbChapter, chapter) &&
- downloadManager.isChapterDownloaded(dbChapter.name, dbChapter.scanlator, manga.title, manga.source)
+ downloadManager.isChapterDownloaded(
+ dbChapter.name, dbChapter.scanlator, manga.title, manga.source,
+ )
if (shouldRenameChapter) {
downloadManager.renameChapter(source, manga, dbChapter, chapter)
@@ -206,6 +210,10 @@ class SyncChaptersWithSource(
val reAddedUrls = reAdded.map { it.url }.toHashSet()
- return updatedToAdd.filterNot { it.url in reAddedUrls }
+ val excludedScanlators = getExcludedScanlators.await(manga.id).toHashSet()
+
+ return updatedToAdd.filterNot {
+ it.url in reAddedUrls || it.scanlator in excludedScanlators
+ }
}
}
diff --git a/app/src/main/java/eu/kanade/domain/chapter/model/Chapter.kt b/app/src/main/java/eu/kanade/domain/chapter/model/Chapter.kt
index 3e094ba97..76d92a3ad 100644
--- a/app/src/main/java/eu/kanade/domain/chapter/model/Chapter.kt
+++ b/app/src/main/java/eu/kanade/domain/chapter/model/Chapter.kt
@@ -2,7 +2,6 @@ package eu.kanade.domain.chapter.model
import eu.kanade.tachiyomi.data.database.models.ChapterImpl
import eu.kanade.tachiyomi.source.model.SChapter
-import tachiyomi.data.Chapters
import tachiyomi.domain.chapter.model.Chapter
import eu.kanade.tachiyomi.data.database.models.Chapter as DbChapter
@@ -23,18 +22,7 @@ fun Chapter.copyFromSChapter(sChapter: SChapter): Chapter {
url = sChapter.url,
dateUpload = sChapter.date_upload,
chapterNumber = sChapter.chapter_number.toDouble(),
- scanlator = sChapter.scanlator?.ifBlank { null },
- )
-}
-
-fun Chapter.copyFrom(other: Chapters): Chapter {
- return copy(
- name = other.name,
- url = other.url,
- dateUpload = other.date_upload,
- chapterNumber = other.chapter_number,
- scanlator = other.scanlator?.ifBlank { null },
- lastModifiedAt = other.last_modified_at,
+ scanlator = sChapter.scanlator?.ifBlank { null }?.trim(),
)
}
diff --git a/app/src/main/java/eu/kanade/domain/chapter/model/ChapterFilter.kt b/app/src/main/java/eu/kanade/domain/chapter/model/ChapterFilter.kt
index 623ddd751..ad476418f 100644
--- a/app/src/main/java/eu/kanade/domain/chapter/model/ChapterFilter.kt
+++ b/app/src/main/java/eu/kanade/domain/chapter/model/ChapterFilter.kt
@@ -2,7 +2,7 @@ package eu.kanade.domain.chapter.model
import eu.kanade.domain.manga.model.downloadedFilter
import eu.kanade.tachiyomi.data.download.DownloadManager
-import eu.kanade.tachiyomi.ui.manga.ChapterItem
+import eu.kanade.tachiyomi.ui.manga.ChapterList
import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.chapter.service.getChapterSort
import tachiyomi.domain.manga.model.Manga
@@ -23,7 +23,12 @@ fun List.applyFilters(manga: Manga, downloadManager: DownloadManager):
.filter { chapter -> applyFilter(bookmarkedFilter) { chapter.bookmark } }
.filter { chapter ->
applyFilter(downloadedFilter) {
- val downloaded = downloadManager.isChapterDownloaded(chapter.name, chapter.scanlator, manga.title, manga.source)
+ val downloaded = downloadManager.isChapterDownloaded(
+ chapter.name,
+ chapter.scanlator,
+ manga.title,
+ manga.source,
+ )
downloaded || isLocalManga
}
}
@@ -34,7 +39,7 @@ fun List.applyFilters(manga: Manga, downloadManager: DownloadManager):
* Applies the view filters to the list of chapters obtained from the database.
* @return an observable of the list of chapters filtered and sorted.
*/
-fun List.applyFilters(manga: Manga): Sequence {
+fun List.applyFilters(manga: Manga): Sequence {
val isLocalManga = manga.isLocal()
val unreadFilter = manga.unreadFilter
val downloadedFilter = manga.downloadedFilter
diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/GetExcludedScanlators.kt b/app/src/main/java/eu/kanade/domain/manga/interactor/GetExcludedScanlators.kt
new file mode 100644
index 000000000..dc326f209
--- /dev/null
+++ b/app/src/main/java/eu/kanade/domain/manga/interactor/GetExcludedScanlators.kt
@@ -0,0 +1,24 @@
+package eu.kanade.domain.manga.interactor
+
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.map
+import tachiyomi.data.DatabaseHandler
+
+class GetExcludedScanlators(
+ private val handler: DatabaseHandler,
+) {
+
+ suspend fun await(mangaId: Long): Set {
+ return handler.awaitList {
+ excluded_scanlatorsQueries.getExcludedScanlatorsByMangaId(mangaId)
+ }
+ .toSet()
+ }
+
+ fun subscribe(mangaId: Long): Flow> {
+ return handler.subscribeToList {
+ excluded_scanlatorsQueries.getExcludedScanlatorsByMangaId(mangaId)
+ }
+ .map { it.toSet() }
+ }
+}
diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/SetExcludedScanlators.kt b/app/src/main/java/eu/kanade/domain/manga/interactor/SetExcludedScanlators.kt
new file mode 100644
index 000000000..a52fb9afd
--- /dev/null
+++ b/app/src/main/java/eu/kanade/domain/manga/interactor/SetExcludedScanlators.kt
@@ -0,0 +1,22 @@
+package eu.kanade.domain.manga.interactor
+
+import tachiyomi.data.DatabaseHandler
+
+class SetExcludedScanlators(
+ private val handler: DatabaseHandler,
+) {
+
+ suspend fun await(mangaId: Long, excludedScanlators: Set) {
+ handler.await(inTransaction = true) {
+ val currentExcluded = handler.awaitList {
+ excluded_scanlatorsQueries.getExcludedScanlatorsByMangaId(mangaId)
+ }.toSet()
+ val toAdd = excludedScanlators.minus(currentExcluded)
+ for (scanlator in toAdd) {
+ excluded_scanlatorsQueries.insert(mangaId, scanlator)
+ }
+ val toRemove = currentExcluded.minus(excludedScanlators)
+ excluded_scanlatorsQueries.remove(mangaId, toRemove)
+ }
+ }
+}
diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaViewerFlags.kt b/app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaViewerFlags.kt
index 521be8b8c..083d26e98 100644
--- a/app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaViewerFlags.kt
+++ b/app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaViewerFlags.kt
@@ -1,7 +1,7 @@
package eu.kanade.domain.manga.interactor
-import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
-import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
+import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation
+import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode
import tachiyomi.domain.manga.model.MangaUpdate
import tachiyomi.domain.manga.repository.MangaRepository
@@ -9,22 +9,22 @@ class SetMangaViewerFlags(
private val mangaRepository: MangaRepository,
) {
- suspend fun awaitSetMangaReadingMode(id: Long, flag: Long) {
+ suspend fun awaitSetReadingMode(id: Long, flag: Long) {
val manga = mangaRepository.getMangaById(id)
mangaRepository.update(
MangaUpdate(
id = id,
- viewerFlags = manga.viewerFlags.setFlag(flag, ReadingModeType.MASK.toLong()),
+ viewerFlags = manga.viewerFlags.setFlag(flag, ReadingMode.MASK.toLong()),
),
)
}
- suspend fun awaitSetOrientationType(id: Long, flag: Long) {
+ suspend fun awaitSetOrientation(id: Long, flag: Long) {
val manga = mangaRepository.getMangaById(id)
mangaRepository.update(
MangaUpdate(
id = id,
- viewerFlags = manga.viewerFlags.setFlag(flag, OrientationType.MASK.toLong()),
+ viewerFlags = manga.viewerFlags.setFlag(flag, ReaderOrientation.MASK.toLong()),
),
)
}
diff --git a/app/src/main/java/eu/kanade/domain/manga/model/Manga.kt b/app/src/main/java/eu/kanade/domain/manga/model/Manga.kt
index 6c2ee4a5e..686b29f43 100644
--- a/app/src/main/java/eu/kanade/domain/manga/model/Manga.kt
+++ b/app/src/main/java/eu/kanade/domain/manga/model/Manga.kt
@@ -3,8 +3,8 @@ package eu.kanade.domain.manga.model
import eu.kanade.domain.base.BasePreferences
import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.source.model.SManga
-import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
-import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
+import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation
+import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode
import tachiyomi.core.metadata.comicinfo.ComicInfo
import tachiyomi.core.metadata.comicinfo.ComicInfoPublishingStatus
import tachiyomi.core.preference.TriState
@@ -14,11 +14,11 @@ import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
// TODO: move these into the domain model
-val Manga.readingModeType: Long
- get() = viewerFlags and ReadingModeType.MASK.toLong()
+val Manga.readingMode: Long
+ get() = viewerFlags and ReadingMode.MASK.toLong()
-val Manga.orientationType: Long
- get() = viewerFlags and OrientationType.MASK.toLong()
+val Manga.readerOrientation: Long
+ get() = viewerFlags and ReaderOrientation.MASK.toLong()
val Manga.downloadedFilter: TriState
get() {
diff --git a/app/src/main/java/eu/kanade/domain/source/interactor/GetSourcesWithFavoriteCount.kt b/app/src/main/java/eu/kanade/domain/source/interactor/GetSourcesWithFavoriteCount.kt
index 8ca143cc1..c37be75aa 100644
--- a/app/src/main/java/eu/kanade/domain/source/interactor/GetSourcesWithFavoriteCount.kt
+++ b/app/src/main/java/eu/kanade/domain/source/interactor/GetSourcesWithFavoriteCount.kt
@@ -3,12 +3,11 @@ package eu.kanade.domain.source.interactor
import eu.kanade.domain.source.service.SourcePreferences
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
+import tachiyomi.core.util.lang.compareToWithCollator
import tachiyomi.domain.source.model.Source
import tachiyomi.domain.source.repository.SourceRepository
import tachiyomi.source.local.isLocal
-import java.text.Collator
import java.util.Collections
-import java.util.Locale
class GetSourcesWithFavoriteCount(
private val repository: SourceRepository,
@@ -31,17 +30,13 @@ class GetSourcesWithFavoriteCount(
direction: SetMigrateSorting.Direction,
sorting: SetMigrateSorting.Mode,
): java.util.Comparator> {
- val locale = Locale.getDefault()
- val collator = Collator.getInstance(locale).apply {
- strength = Collator.PRIMARY
- }
val sortFn: (Pair