From 4e4bdffdf38043418685ab42b177c8476842c83c Mon Sep 17 00:00:00 2001 From: MajorTanya <39014446+MajorTanya@users.noreply.github.com> Date: Tue, 3 Feb 2026 10:54:22 +0100 Subject: [PATCH] Add "src:" prefix to search by source ID (#2927) Allows users to search for the exact source ID in their library. Similar to the Browse > Migrate screen, but filtered in the Library, where users can take all the usual actions. Could be used in the future to change the search behaviour of tapping the source name in the title info view to search by the ID with this prefix. --- CHANGELOG.md | 1 + .../main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a33e341e1..cfa2b7a6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co - Automatically remove downloads on Suwayomi after reading, configurable via extension settings ([@cpiber](https://github.com/cpiber)) ([#2673](https://github.com/mihonapp/mihon/pull/2673)) - Display author & artist name in MAL search results ([@MajorTanya](https://github.com/MajorTanya)) ([#2833](https://github.com/mihonapp/mihon/pull/2833)) - Add filter options to Updates tab ([@MajorTanya](https://github.com/MajorTanya)) ([#2851](https://github.com/mihonapp/mihon/pull/2851)) +- Add `src:` prefix to search the library by source ID ([@MajorTanya](https://github.com/MajorTanya)) ([#2927](https://github.com/mihonapp/mihon/pull/2927)) ### Improved - Minimize memory usage by reducing in-memory cover cache size ([@Lolle2000la](https://github.com/Lolle2000la)) ([#2266](https://github.com/mihonapp/mihon/pull/2266)) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt index 0818bf4a2..d4ee5329a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt @@ -23,9 +23,12 @@ data class LibraryItem( * @return true if the manga matches the query, false otherwise. */ fun matches(constraint: String): Boolean { - val sourceName by lazy { sourceManager.getOrStub(libraryManga.manga.source).getNameForMangaInfo() } + val source = sourceManager.getOrStub(libraryManga.manga.source) + val sourceName by lazy { source.getNameForMangaInfo() } if (constraint.startsWith("id:", true)) { return id == constraint.substringAfter("id:").toLongOrNull() + } else if (constraint.startsWith("src:", true)) { + return source.id == constraint.substringAfter("src:").toLongOrNull() } return libraryManga.manga.title.contains(constraint, true) || (libraryManga.manga.author?.contains(constraint, true) ?: false) ||