From 24dd530cbc6dd64e9c2fb907c0bbf6b60827582e Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 31 Aug 2026 22:55:56 +0200 Subject: [PATCH] Do not mark a row imported once its listing is gone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The last write is followed by a pause, and an empty remote playlist never reaches a check at all, so the list could be replaced before the import reported itself finished. Marking it then attached to whichever row carries that ID now — on another account, a different playlist shown as already imported. Clearing the in-progress state stays unconditional: it describes a row that is no longer there either way. --- Yattee/Views/Settings/ImportPlaylistsView.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Yattee/Views/Settings/ImportPlaylistsView.swift b/Yattee/Views/Settings/ImportPlaylistsView.swift index 7d253102..90e293fd 100644 --- a/Yattee/Views/Settings/ImportPlaylistsView.swift +++ b/Yattee/Views/Settings/ImportPlaylistsView.swift @@ -474,10 +474,18 @@ struct ImportPlaylistsView: View { } await MainActor.run { - importedPlaylistIDs.insert(playlist.id.playlistID) importingPlaylistID = nil importProgress = nil + // The list can be replaced after the last video is written — + // an empty remote playlist never reaches a check at all. + // Marking it imported would attach to whatever row carries + // that ID now, which on another account is a different + // playlist. + guard generation == listGeneration else { return } + + importedPlaylistIDs.insert(playlist.id.playlistID) + if skippedCount > 0 { appEnvironment.toastManager.showSuccess( String(localized: "import.playlists.added.title"),