mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Improve displaying information in the toolbar
This commit is contained in:
parent
c4a3dab5fb
commit
850f4e6a02
@ -42,9 +42,11 @@ struct VideoThumbnailView: View {
|
||||
Image(systemName: "calendar")
|
||||
Text(video.published)
|
||||
|
||||
if video.views != 0 {
|
||||
Image(systemName: "eye")
|
||||
Text(video.viewsCount)
|
||||
}
|
||||
}
|
||||
.foregroundColor(.secondary)
|
||||
.padding(.top)
|
||||
}
|
||||
@ -53,11 +55,13 @@ struct VideoThumbnailView: View {
|
||||
Spacer()
|
||||
|
||||
HStack(spacing: 8) {
|
||||
if let time = video.playTime {
|
||||
Image(systemName: "clock")
|
||||
|
||||
Text(video.playTime ?? "-")
|
||||
Text(time)
|
||||
.fontWeight(.bold)
|
||||
}
|
||||
}
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
.frame(minHeight: 180)
|
||||
|
@ -50,6 +50,10 @@ final class Video: Identifiable, ObservableObject {
|
||||
}
|
||||
|
||||
var playTime: String? {
|
||||
guard !length.isZero else {
|
||||
return nil
|
||||
}
|
||||
|
||||
let formatter = DateComponentsFormatter()
|
||||
|
||||
formatter.unitsStyle = .positional
|
||||
|
Loading…
Reference in New Issue
Block a user