Do not mark a row imported once its listing is gone

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.
This commit is contained in:
Arkadiusz Fal
2026-08-31 22:55:56 +02:00
parent e767bb9a22
commit 24dd530cbc

View File

@@ -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"),