-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在线源资源太多不容易查找 #1508
Labels
Milestone
Comments
实现了一下, 但我实际测试体验并不好:
综合考虑不采用这个方法. Subject: [PATCH] f
---
Index: app/shared/src/commonMain/kotlin/ui/subject/episode/mediaFetch/MediaGroup.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/shared/src/commonMain/kotlin/ui/subject/episode/mediaFetch/MediaGroup.kt b/app/shared/src/commonMain/kotlin/ui/subject/episode/mediaFetch/MediaGroup.kt
--- a/app/shared/src/commonMain/kotlin/ui/subject/episode/mediaFetch/MediaGroup.kt (revision 653de44ab3492bead120928facfdb1f907146b9e)
+++ b/app/shared/src/commonMain/kotlin/ui/subject/episode/mediaFetch/MediaGroup.kt (date 1737072954250)
@@ -49,6 +49,7 @@
object MediaGrouper {
fun getGroupId(media: Media): String {
return when (media.kind) {
+ MediaSourceKind.WEB,
MediaSourceKind.BitTorrent -> {
var title = media.originalTitle
if (title.startsWith('[')) {
@@ -57,7 +58,6 @@
return title
}
- MediaSourceKind.WEB,
MediaSourceKind.LocalCache -> media.mediaId
}
}
Index: app/shared/src/commonMain/kotlin/ui/subject/episode/mediaFetch/MediaSelectorItem.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/shared/src/commonMain/kotlin/ui/subject/episode/mediaFetch/MediaSelectorItem.kt b/app/shared/src/commonMain/kotlin/ui/subject/episode/mediaFetch/MediaSelectorItem.kt
--- a/app/shared/src/commonMain/kotlin/ui/subject/episode/mediaFetch/MediaSelectorItem.kt (revision 653de44ab3492bead120928facfdb1f907146b9e)
+++ b/app/shared/src/commonMain/kotlin/ui/subject/episode/mediaFetch/MediaSelectorItem.kt (date 1737073447234)
@@ -50,11 +50,12 @@
import me.him188.ani.app.domain.media.selector.UnsafeOriginalMediaAccess
import me.him188.ani.app.platform.currentAniBuildConfig
import me.him188.ani.app.tools.formatDateTime
-import me.him188.ani.app.ui.foundation.theme.weaken
import me.him188.ani.app.ui.media.renderSubtitleLanguage
import me.him188.ani.app.ui.settings.rendering.MediaSourceIcon
import me.him188.ani.app.ui.settings.rendering.MediaSourceIcons
import me.him188.ani.datasources.api.Media
+import me.him188.ani.datasources.api.source.MediaSourceInfo
+import me.him188.ani.datasources.api.source.MediaSourceKind
import me.him188.ani.datasources.api.topic.FileSize
@@ -264,9 +265,10 @@
var showMenu by rememberSaveable { mutableStateOf(false) }
ExposedDropdownMenuBox(showMenu, { showMenu = it }, modifier) {
val currentItem = groupState.selectedItem ?: group.first.original
- val currentSourceInfo by mediaSourceInfoProvider.rememberMediaSourceInfo(currentItem.mediaSourceId)
+ val currentSourceInfo = mediaSourceInfoProvider.rememberMediaSourceInfo(currentItem.mediaSourceId).value
+
TextField(
- value = currentSourceInfo?.displayName ?: "未知",
+ value = renderMediaSourceDisplay(currentSourceInfo, currentItem),
onValueChange = {},
Modifier
.widthIn(min = 48.dp) // override default
@@ -298,7 +300,7 @@
val item = maybeExcluded.original
val sourceInfo by mediaSourceInfoProvider.rememberMediaSourceInfo(item.mediaSourceId)
DropdownMenuItem(
- text = { Text(sourceInfo?.displayName ?: "未知") },
+ text = { renderMediaSourceDisplay(sourceInfo, item) },
leadingIcon = { MediaSourceIcon(sourceInfo, Modifier.size(24.dp)) },
onClick = {
groupState.selectedItem = item
@@ -311,3 +313,17 @@
}
}
}
+
+private fun renderMediaSourceDisplay(
+ currentSourceInfo: MediaSourceInfo?,
+ currentItem: Media
+) = if (currentSourceInfo == null) {
+ "未知"
+} else {
+ if (currentItem.kind == MediaSourceKind.WEB) {
+ // WEB 源, 显示线路名称
+ "${currentSourceInfo.displayName} ${currentItem.properties.alliance}"
+ } else {
+ currentSourceInfo.displayName
+ }
+}
|
考虑提供一个更高信息密度的 UI 视图. 例如考虑去除那些没用的 (而且占一行的) labels. 字幕语言实际上可以用过滤方式完成 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
可以把在线源也 group 起来,点卡片左下角切换源。
The text was updated successfully, but these errors were encountered: