mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
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:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user