mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
Hide the description section when a video has no description
Direct media links have no description, so the info page showed a divider and a "No description available" placeholder under the channel row. Skip the section entirely (divider included) unless there is a description or details are still loading, and drop the unused player.noDescription string.
This commit is contained in:
@@ -8284,17 +8284,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"player.noDescription" : {
|
||||
"comment" : "Shown when video has no description",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "No description available"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"player.notPlaying" : {
|
||||
"comment" : "Placeholder when no video is playing",
|
||||
"localizations" : {
|
||||
|
||||
@@ -92,7 +92,7 @@ struct InfoPanelPage: View {
|
||||
PanelPageScrollView(config: scrollConfig) { proxy in
|
||||
videoInfo
|
||||
|
||||
if settings.effectiveShowDescription {
|
||||
if showsDescriptionSection {
|
||||
Divider()
|
||||
.panelHorizontalPadding()
|
||||
|
||||
@@ -167,10 +167,17 @@ struct InfoPanelPage: View {
|
||||
|
||||
// MARK: - Description
|
||||
|
||||
private var descriptionContent: some View {
|
||||
let description = video.description ?? ""
|
||||
private var description: String { video.description ?? "" }
|
||||
|
||||
return VStack(alignment: .leading, spacing: 8) {
|
||||
/// Nothing renders below the video info when there is no description and
|
||||
/// nothing is loading — no placeholder, no divider (direct media links).
|
||||
private var showsDescriptionSection: Bool {
|
||||
settings.effectiveShowDescription
|
||||
&& (!description.isEmpty || videoDetailsState == .loading)
|
||||
}
|
||||
|
||||
private var descriptionContent: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
if !description.isEmpty {
|
||||
if usesCollapsedDescription {
|
||||
collapsibleDescription(description)
|
||||
@@ -189,11 +196,6 @@ struct InfoPanelPage: View {
|
||||
Spacer()
|
||||
}
|
||||
.padding()
|
||||
} else {
|
||||
Text(String(localized: "player.noDescription"))
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.secondary)
|
||||
.panelHorizontalPadding()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user