mirror of
https://github.com/yattee/yattee.git
synced 2024-11-09 15:58:20 +00:00
Minor fixes
This commit is contained in:
parent
ba1ec7c559
commit
af85c67163
@ -464,6 +464,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
|
||||
instanceID: account.instanceID,
|
||||
app: .invidious,
|
||||
instanceURL: account.instance.apiURL,
|
||||
id: id,
|
||||
videoID: videoID,
|
||||
title: json["title"].stringValue,
|
||||
author: json["author"].stringValue,
|
||||
|
@ -217,7 +217,15 @@ struct Video: Identifiable, Equatable, Hashable {
|
||||
}
|
||||
|
||||
var publishedDate: String? {
|
||||
(published.isEmpty || published == "0 seconds ago") ? publishedAt?.timeIntervalSince1970.formattedAsRelativeTime() : published
|
||||
guard let publishedAt else {
|
||||
return (published.isEmpty || published == "0 seconds ago") ? nil : published
|
||||
}
|
||||
|
||||
let dateFormatter = DateFormatter()
|
||||
dateFormatter.dateStyle = .short
|
||||
dateFormatter.timeStyle = .none
|
||||
|
||||
return dateFormatter.string(from: publishedAt)
|
||||
}
|
||||
|
||||
var viewsCount: String? {
|
||||
|
@ -2,7 +2,7 @@ import SwiftUI
|
||||
|
||||
struct NoDocumentsView: View {
|
||||
var body: some View {
|
||||
VStack(alignment: .center, spacing: 20) {
|
||||
VStack(spacing: 20) {
|
||||
HStack {
|
||||
Image(systemName: "doc")
|
||||
Text("No documents")
|
||||
|
@ -101,7 +101,9 @@ struct OpenURLHandler {
|
||||
|
||||
player.videoBeingOpened = Video(app: accounts.current.app!, videoID: id)
|
||||
|
||||
player.playerAPI(player.videoBeingOpened!).video(id)
|
||||
player
|
||||
.playerAPI(player.videoBeingOpened!)
|
||||
.video(id)
|
||||
.load()
|
||||
.onSuccess { response in
|
||||
if let video: Video = response.typedContent() {
|
||||
|
@ -5,7 +5,7 @@ struct NoCommentsView: View {
|
||||
var systemImage: String
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .center, spacing: 10) {
|
||||
VStack(spacing: 10) {
|
||||
Image(systemName: systemImage)
|
||||
.font(.system(size: 36))
|
||||
|
||||
|
@ -55,7 +55,7 @@ struct VideoDescription: View {
|
||||
Button {
|
||||
NavigationModel.shared.openSearchQuery(keyword)
|
||||
} label: {
|
||||
HStack(alignment: .center, spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
Text("#")
|
||||
.font(.system(size: 14).bold())
|
||||
|
||||
|
@ -120,7 +120,7 @@ struct VideoDetails: View {
|
||||
descriptionVisibility = true
|
||||
return
|
||||
}
|
||||
Delay.by(0.3) { withAnimation(.easeOut(duration: 0.2)) { self.descriptionVisibility = true } }
|
||||
Delay.by(0.4) { withAnimation(.easeIn(duration: 0.25)) { self.descriptionVisibility = true } }
|
||||
}
|
||||
#endif
|
||||
.transition(.opacity)
|
||||
|
Loading…
Reference in New Issue
Block a user