From 5fc68123c3bdac7b3d466f7f531c37c0b0158f38 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Mon, 1 Jul 2024 08:43:25 +0200 Subject: [PATCH] Call the already existing method to remove artworks --- Classes/PropertyView/MovieViewController.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Classes/PropertyView/MovieViewController.swift b/Classes/PropertyView/MovieViewController.swift index 324804a..bc73d88 100644 --- a/Classes/PropertyView/MovieViewController.swift +++ b/Classes/PropertyView/MovieViewController.swift @@ -863,6 +863,7 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie updateArtworksArray() artworksView.reloadData() + updateSelection() } private func replace(metadataArtworks items: [MP42MetadataItem], withItems newItems: [MP42MetadataItem]) { @@ -885,10 +886,7 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie } @IBAction func removeArtwork(_ sender: Any?) { - let selectedIndexes = artworksView.selectionIndexes - artworks = IndexSet(artworks.indices).subtracting(selectedIndexes).map {artworks[$0]} - artworksView.deleteItems(at: artworksView.selectionIndexPaths) - updateSelection() + remove(metadataArtworks: artworksView.selectionIndexes.map { artworks[$0] }) } private func add(artworks: [Any], toIndexPath: IndexPath) -> Bool {