From 2c004b81fe2cf97f942c7c494d35881613bf9147 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 12 Nov 2022 01:40:55 +0100 Subject: [PATCH] Close item if could not be opened --- Model/Player/Backends/AVPlayerBackend.swift | 1 + Model/Player/Backends/MPVBackend.swift | 1 + 2 files changed, 2 insertions(+) diff --git a/Model/Player/Backends/AVPlayerBackend.swift b/Model/Player/Backends/AVPlayerBackend.swift index c7a795c0..e0934aba 100644 --- a/Model/Player/Backends/AVPlayerBackend.swift +++ b/Model/Player/Backends/AVPlayerBackend.swift @@ -133,6 +133,7 @@ final class AVPlayerBackend: PlayerBackend { if video.isLocal, video.localStreamIsFile, let localURL = video.localStream?.localURL { guard localURL.startAccessingSecurityScopedResource() else { model.navigation.presentAlert(title: "Could not open file") + model.closeCurrentItem() return } url = localURL diff --git a/Model/Player/Backends/MPVBackend.swift b/Model/Player/Backends/MPVBackend.swift index 7987c072..9c0ea133 100644 --- a/Model/Player/Backends/MPVBackend.swift +++ b/Model/Player/Backends/MPVBackend.swift @@ -293,6 +293,7 @@ final class MPVBackend: PlayerBackend { if video.isLocal, video.localStreamIsFile, let localStream = video.localStream { guard localStream.localURL.startAccessingSecurityScopedResource() else { self.model.navigation.presentAlert(title: "Could not open file") + self.model.closeCurrentItem() return } }