diff --git a/backend/config.go b/backend/config.go index 4d409678..436c68a8 100644 --- a/backend/config.go +++ b/backend/config.go @@ -44,6 +44,7 @@ type AppConfig struct { SavePlayQueue bool SaveQueueToServer bool DefaultPlaylistID string + AddToPlaylistSkipDuplicates bool ShowTrackChangeNotification bool EnableLrcLib bool SkipSSLVerify bool diff --git a/ui/controller/controller.go b/ui/controller/controller.go index 8174b8a5..f985b633 100644 --- a/ui/controller/controller.go +++ b/ui/controller/controller.go @@ -271,7 +271,8 @@ func (m *Controller) PromptForFirstServer() { // Depending on the results of that dialog, potentially create a new playlist // Add tracks to the user-specified playlist func (m *Controller) DoAddTracksToPlaylistWorkflow(trackIDs []string) { - sp := dialogs.NewSelectPlaylistDialog(m.App.ServerManager.Server, m.App.ImageManager, m.App.ServerManager.LoggedInUser) + sp := dialogs.NewSelectPlaylistDialog(m.App.ServerManager.Server, m.App.ImageManager, + m.App.ServerManager.LoggedInUser, m.App.Config.Application.AddToPlaylistSkipDuplicates) pop := widget.NewModalPopUp(sp.SearchDialog, m.MainWindow.Canvas()) sp.SetOnDismiss(func() { pop.Hide() @@ -279,6 +280,7 @@ func (m *Controller) DoAddTracksToPlaylistWorkflow(trackIDs []string) { }) sp.SetOnNavigateTo(func(contentType mediaprovider.ContentType, id string) { pop.Hide() + m.App.Config.Application.AddToPlaylistSkipDuplicates = sp.SkipDuplicates if id == "" /* creating new playlist */ { go m.App.ServerManager.Server.CreatePlaylist(sp.SearchDialog.SearchQuery(), trackIDs) } else { diff --git a/ui/dialogs/selectplaylist.go b/ui/dialogs/selectplaylist.go index c2957ce4..aa579adf 100644 --- a/ui/dialogs/selectplaylist.go +++ b/ui/dialogs/selectplaylist.go @@ -24,11 +24,11 @@ type SelectPlaylist struct { SkipDuplicates bool } -func NewSelectPlaylistDialog(mp mediaprovider.MediaProvider, im util.ImageFetcher, loggedInUser string) *SelectPlaylist { +func NewSelectPlaylistDialog(mp mediaprovider.MediaProvider, im util.ImageFetcher, loggedInUser string, skipDups bool) *SelectPlaylist { sp := &SelectPlaylist{ mp: mp, loggedInUser: loggedInUser, - SkipDuplicates: false, + SkipDuplicates: skipDups, } sd := NewSearchDialog( im,