diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt index e476cb7f7..8145133b1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt @@ -76,6 +76,12 @@ class MyAnimeList(private val context: Context, id: Int) : TrackService(id) { } override fun search(query: String): Observable> { + if (query.startsWith("my:")) { + query.substringAfter("my:").toIntOrNull()?.let { id -> + return runAsObservable({ listOf(api.getMangaDetails(id)) }) + } + } + return runAsObservable({ api.search(query) }) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt index cecf27571..fa1845bc6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt @@ -79,7 +79,7 @@ class MyAnimeListApi(private val client: OkHttpClient, interceptor: MyAnimeListI } } - private suspend fun getMangaDetails(id: Int): TrackSearch { + suspend fun getMangaDetails(id: Int): TrackSearch { return withContext(Dispatchers.IO) { val url = "$baseApiUrl/manga".toUri().buildUpon() .appendPath(id.toString())