Trim MAL & MB id: query before lookup (#3793)
This was included for all other trackers in #3776 but these two had prefix search before. It's a small change, but it can go a long way when using `id:` with copy-pasted IDs from elsewhere which come with starting or trailing whitespace.
This commit is contained in:
@@ -104,7 +104,7 @@ class MangaBaka(id: Long) : BaseTracker(id, "MangaBaka"), DeletableTracker {
|
||||
|
||||
override suspend fun search(query: String): List<TrackSearch> {
|
||||
if (query.startsWith(SEARCH_ID_PREFIX)) {
|
||||
query.substringAfter(SEARCH_ID_PREFIX).toIntOrNull()?.let { id ->
|
||||
query.substringAfter(SEARCH_ID_PREFIX).trim().toIntOrNull()?.let { id ->
|
||||
return api.getMangaDetails(id)?.let { listOf(it) } ?: emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ class MyAnimeList(id: Long) : BaseTracker(id, "MyAnimeList"), DeletableTracker {
|
||||
|
||||
override suspend fun search(query: String): List<TrackSearch> {
|
||||
if (query.startsWith(SEARCH_ID_PREFIX)) {
|
||||
query.substringAfter(SEARCH_ID_PREFIX).toIntOrNull()?.let { id ->
|
||||
query.substringAfter(SEARCH_ID_PREFIX).trim().toIntOrNull()?.let { id ->
|
||||
return listOf(api.getMangaDetails(id))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user