mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-23 13:45:43 +03:00
MangaPresenter: Filter unsupported track service from available service list (#8286)
This commit is contained in:
parent
15f7e53e4f
commit
82b552ac9a
1 changed files with 5 additions and 3 deletions
|
@ -861,9 +861,11 @@ class MangaPresenter(
|
|||
.catch { logcat(LogPriority.ERROR, it) }
|
||||
.map { tracks ->
|
||||
val dbTracks = tracks.map { it.toDbTrack() }
|
||||
loggedServices.map { service ->
|
||||
TrackItem(dbTracks.find { it.sync_id.toLong() == service.id }, service)
|
||||
}
|
||||
loggedServices
|
||||
// Map to TrackItem
|
||||
.map { service -> TrackItem(dbTracks.find { it.sync_id.toLong() == service.id }, service) }
|
||||
// Show only if the service supports this manga's source
|
||||
.filter { (it.service as? EnhancedTrackService)?.accept(source!!) ?: true }
|
||||
}
|
||||
.collectLatest { trackItems ->
|
||||
_trackList = trackItems
|
||||
|
|
Loading…
Reference in a new issue