Skip to content

Commit

Permalink
fix(tracking): Don't show unusable tracking services (#1174)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdallahmehiz authored Oct 25, 2023
1 parent ee33c14 commit afb921a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import eu.kanade.presentation.track.anime.AnimeTrackInfoDialogHome
import eu.kanade.presentation.track.anime.AnimeTrackServiceSearch
import eu.kanade.presentation.util.Screen
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.TrackManager
import eu.kanade.tachiyomi.data.track.TrackService
Expand Down Expand Up @@ -249,7 +250,9 @@ data class AnimeTrackInfoDialogHomeScreen(

private fun List<AnimeTrack>.mapToTrackItem(): List<AnimeTrackItem> {
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)
return loggedServices
// Map to TrackItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import eu.kanade.presentation.track.manga.MangaTrackServiceSearch
import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.R
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.TrackService
import eu.kanade.tachiyomi.data.track.model.MangaTrackSearch
Expand Down Expand Up @@ -248,7 +249,9 @@ data class MangaTrackInfoDialogHomeScreen(
}

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)
return loggedServices
// Map to TrackItem
Expand Down

0 comments on commit afb921a

Please sign in to comment.