Show video title placeholder while thumbnails load

This commit is contained in:
Arkadiusz Fal
2026-04-17 06:23:31 +02:00
parent 6090454707
commit abd432fd0e
2 changed files with 17 additions and 21 deletions

View File

@@ -67,10 +67,10 @@ struct DeArrowVideoThumbnail: View {
private var downloadProgressIndeterminate: Bool { false }
#endif
/// Title to show on placeholder for media source videos without thumbnails.
/// Title to show on placeholder while the thumbnail is loading or absent.
private var placeholderTitle: String? {
guard displayThumbnailURL == nil, video.isFromMediaSource else { return nil }
return video.title
let title = video.displayTitle(using: deArrowProvider)
return title.isEmpty ? nil : title
}
/// Whether to show watched checkmark from settings.

View File

@@ -638,15 +638,13 @@ struct VideoInfoView: View {
Rectangle()
.fill(.quaternary)
.overlay {
if video.bestThumbnail?.url == nil, video.isFromMediaSource {
Text(video.displayTitle(using: appEnvironment?.deArrowBrandingProvider))
.font(.caption)
.fontWeight(.medium)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
.lineLimit(3)
.padding(8)
}
Text(video.displayTitle(using: appEnvironment?.deArrowBrandingProvider))
.font(.caption)
.fontWeight(.medium)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
.lineLimit(3)
.padding(8)
}
}
}
@@ -939,15 +937,13 @@ struct VideoInfoView: View {
.fill(.quaternary)
.clipShape(RoundedRectangle(cornerRadius: 8))
.overlay {
if video.bestThumbnail?.url == nil, video.isFromMediaSource {
Text(video.displayTitle(using: appEnvironment?.deArrowBrandingProvider))
.font(.caption)
.fontWeight(.medium)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
.lineLimit(3)
.padding(8)
}
Text(video.displayTitle(using: appEnvironment?.deArrowBrandingProvider))
.font(.caption)
.fontWeight(.medium)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
.lineLimit(3)
.padding(8)
}
}
}