mirror of
https://github.com/yattee/yattee.git
synced 2026-02-20 01:39:46 +00:00
Refactor views
This commit is contained in:
@@ -9,11 +9,6 @@ import SwiftUI
|
||||
|
||||
#if !os(tvOS)
|
||||
struct DownloadQualitySheet: View {
|
||||
let video: Video
|
||||
var streams: [Stream] = []
|
||||
var captions: [Caption] = []
|
||||
var dislikeCount: Int?
|
||||
|
||||
enum DownloadTab: String, CaseIterable {
|
||||
case video
|
||||
case audio
|
||||
@@ -31,6 +26,11 @@ struct DownloadQualitySheet: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@Environment(\.appEnvironment) private var appEnvironment
|
||||
|
||||
let video: Video
|
||||
var streams: [Stream] = []
|
||||
var captions: [Caption] = []
|
||||
var dislikeCount: Int?
|
||||
|
||||
@State private var selectedTab: DownloadTab = .video
|
||||
@State private var selectedVideoStream: Stream?
|
||||
@State private var selectedAudioStream: Stream?
|
||||
|
||||
@@ -10,11 +10,11 @@ import SwiftUI
|
||||
/// View for extracting and playing videos from external sites (non-YouTube/PeerTube).
|
||||
/// Uses Yattee Server's yt-dlp integration to extract video information.
|
||||
struct ExternalVideoView: View {
|
||||
let url: URL
|
||||
|
||||
@Environment(\.appEnvironment) private var appEnvironment
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
let url: URL
|
||||
|
||||
@State private var isLoading = true
|
||||
@State private var errorMessage: String?
|
||||
@State private var shouldDismissWhenPlayerExpands = false
|
||||
|
||||
@@ -9,11 +9,11 @@ import SwiftUI
|
||||
import NukeUI
|
||||
|
||||
struct PlaylistSelectorSheet: View {
|
||||
let video: Video
|
||||
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@Environment(\.appEnvironment) private var appEnvironment
|
||||
|
||||
let video: Video
|
||||
|
||||
@State private var playlists: [LocalPlaylist] = []
|
||||
@State private var showingNewPlaylist = false
|
||||
@State private var pendingPlaylistTitle: String?
|
||||
|
||||
@@ -15,11 +15,11 @@ enum VideoInfoInitMode: Sendable {
|
||||
}
|
||||
|
||||
struct VideoInfoView: View {
|
||||
private let initMode: VideoInfoInitMode
|
||||
|
||||
@Environment(\.appEnvironment) private var appEnvironment
|
||||
@Environment(\.videoQueueContext) private var videoQueueContext
|
||||
|
||||
|
||||
private let initMode: VideoInfoInitMode
|
||||
|
||||
// Video loading state (for videoID mode)
|
||||
@State private var loadedVideo: Video?
|
||||
@State private var isLoadingInitialVideo = false
|
||||
|
||||
Reference in New Issue
Block a user