fix(tracking): Don't show unusable tracking services (#1174)

This commit is contained in:
Abdallah 2023-10-25 19:09:43 +01:00 committed by GitHub
parent ee33c145a5
commit afb921a5a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -47,6 +47,7 @@ import eu.kanade.presentation.track.anime.AnimeTrackInfoDialogHome
import eu.kanade.presentation.track.anime.AnimeTrackServiceSearch import eu.kanade.presentation.track.anime.AnimeTrackServiceSearch
import eu.kanade.presentation.util.Screen import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.track.AnimeTrackService
import eu.kanade.tachiyomi.data.track.EnhancedAnimeTrackService import eu.kanade.tachiyomi.data.track.EnhancedAnimeTrackService
import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.TrackService
@ -249,7 +250,9 @@ data class AnimeTrackInfoDialogHomeScreen(
private fun List<AnimeTrack>.mapToTrackItem(): List<AnimeTrackItem> { private fun List<AnimeTrack>.mapToTrackItem(): List<AnimeTrackItem> {
val dbTracks = map { it.toDbTrack() } val dbTracks = map { it.toDbTrack() }
val loggedServices = Injekt.get<TrackManager>().services.filter { it.isLogged } val loggedServices = Injekt.get<TrackManager>().services.filter {
it.isLogged && it is AnimeTrackService
}
val source = Injekt.get<AnimeSourceManager>().getOrStub(sourceId) val source = Injekt.get<AnimeSourceManager>().getOrStub(sourceId)
return loggedServices return loggedServices
// Map to TrackItem // Map to TrackItem

View file

@ -48,6 +48,7 @@ import eu.kanade.presentation.track.manga.MangaTrackServiceSearch
import eu.kanade.presentation.util.Screen import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.track.EnhancedMangaTrackService import eu.kanade.tachiyomi.data.track.EnhancedMangaTrackService
import eu.kanade.tachiyomi.data.track.MangaTrackService
import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.TrackService
import eu.kanade.tachiyomi.data.track.model.MangaTrackSearch import eu.kanade.tachiyomi.data.track.model.MangaTrackSearch
@ -248,7 +249,9 @@ data class MangaTrackInfoDialogHomeScreen(
} }
private fun List<MangaTrack>.mapToTrackItem(): List<MangaTrackItem> { private fun List<MangaTrack>.mapToTrackItem(): List<MangaTrackItem> {
val loggedServices = Injekt.get<TrackManager>().services.filter { it.isLogged } val loggedServices = Injekt.get<TrackManager>().services.filter {
it.isLogged && it is MangaTrackService
}
val source = Injekt.get<MangaSourceManager>().getOrStub(sourceId) val source = Injekt.get<MangaSourceManager>().getOrStub(sourceId)
return loggedServices return loggedServices
// Map to TrackItem // Map to TrackItem