mirror of
https://github.com/yattee/yattee.git
synced 2026-05-14 11:25:02 +00:00
Show video title placeholder while thumbnails load
This commit is contained in:
@@ -67,10 +67,10 @@ struct DeArrowVideoThumbnail: View {
|
|||||||
private var downloadProgressIndeterminate: Bool { false }
|
private var downloadProgressIndeterminate: Bool { false }
|
||||||
#endif
|
#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? {
|
private var placeholderTitle: String? {
|
||||||
guard displayThumbnailURL == nil, video.isFromMediaSource else { return nil }
|
let title = video.displayTitle(using: deArrowProvider)
|
||||||
return video.title
|
return title.isEmpty ? nil : title
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Whether to show watched checkmark from settings.
|
/// Whether to show watched checkmark from settings.
|
||||||
|
|||||||
@@ -638,15 +638,13 @@ struct VideoInfoView: View {
|
|||||||
Rectangle()
|
Rectangle()
|
||||||
.fill(.quaternary)
|
.fill(.quaternary)
|
||||||
.overlay {
|
.overlay {
|
||||||
if video.bestThumbnail?.url == nil, video.isFromMediaSource {
|
Text(video.displayTitle(using: appEnvironment?.deArrowBrandingProvider))
|
||||||
Text(video.displayTitle(using: appEnvironment?.deArrowBrandingProvider))
|
.font(.caption)
|
||||||
.font(.caption)
|
.fontWeight(.medium)
|
||||||
.fontWeight(.medium)
|
.foregroundStyle(.secondary)
|
||||||
.foregroundStyle(.secondary)
|
.multilineTextAlignment(.center)
|
||||||
.multilineTextAlignment(.center)
|
.lineLimit(3)
|
||||||
.lineLimit(3)
|
.padding(8)
|
||||||
.padding(8)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -939,15 +937,13 @@ struct VideoInfoView: View {
|
|||||||
.fill(.quaternary)
|
.fill(.quaternary)
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 8))
|
.clipShape(RoundedRectangle(cornerRadius: 8))
|
||||||
.overlay {
|
.overlay {
|
||||||
if video.bestThumbnail?.url == nil, video.isFromMediaSource {
|
Text(video.displayTitle(using: appEnvironment?.deArrowBrandingProvider))
|
||||||
Text(video.displayTitle(using: appEnvironment?.deArrowBrandingProvider))
|
.font(.caption)
|
||||||
.font(.caption)
|
.fontWeight(.medium)
|
||||||
.fontWeight(.medium)
|
.foregroundStyle(.secondary)
|
||||||
.foregroundStyle(.secondary)
|
.multilineTextAlignment(.center)
|
||||||
.multilineTextAlignment(.center)
|
.lineLimit(3)
|
||||||
.lineLimit(3)
|
.padding(8)
|
||||||
.padding(8)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user