From aeb7bac886fac5a24d16fc1e529be456bd0071d2 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Thu, 10 Nov 2022 22:20:35 +0100 Subject: [PATCH] Minor open videos improvements --- Model/OpenVideosModel.swift | 4 ++++ Shared/Views/OpenVideosView.swift | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Model/OpenVideosModel.swift b/Model/OpenVideosModel.swift index cca129ca..03a21752 100644 --- a/Model/OpenVideosModel.swift +++ b/Model/OpenVideosModel.swift @@ -67,6 +67,10 @@ struct OpenVideosModel { } func openURLs(_ urls: [URL], removeQueueItems: Bool, playbackMode: OpenVideosModel.PlaybackMode) { + guard !urls.isEmpty else { + return + } + logger.info("opening \(urls.count) urls") urls.forEach { logger.info("\($0.absoluteString)") } diff --git a/Shared/Views/OpenVideosView.swift b/Shared/Views/OpenVideosView.swift index 067ac247..b0a7de9e 100644 --- a/Shared/Views/OpenVideosView.swift +++ b/Shared/Views/OpenVideosView.swift @@ -2,7 +2,7 @@ import SwiftUI struct OpenVideosView: View { @State private var presentingFileImporter = false - @State private var urlsToOpenText = "https://r.yattee.stream/demo/mp4/1.mp4\nhttps://r.yattee.stream/demo/mp4/2.mp4\nhttps://r.yattee.stream/demo/mp4/3.mp4\nhttps://www.youtube.com/watch?v=N9WHp8DG2WY" + @State private var urlsToOpenText = "" @State private var playbackMode = OpenVideosModel.PlaybackMode.playNow @State private var removeQueueItems = false @@ -46,7 +46,7 @@ struct OpenVideosView: View { TextEditor(text: $urlsToOpenText) .padding(2) .border(Color(white: 0.8), width: 1) - .frame(maxHeight: 200) + .frame(minHeight: 100, maxHeight: 200) #if !os(macOS) .keyboardType(.URL) #endif