go fmt
This commit is contained in:
@@ -11,8 +11,8 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"github.com/dweymouth/supersonic/backend"
|
||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||
@@ -346,20 +346,20 @@ func (m *Controller) DoAddTracksToPlaylistWorkflow(trackIDs []string) {
|
||||
log.Printf("error getting playlist: %s", err.Error())
|
||||
} else {
|
||||
var trackIDsInPaylist []string
|
||||
|
||||
for _, track := range selectedPlaylist.Tracks{
|
||||
|
||||
for _, track := range selectedPlaylist.Tracks {
|
||||
trackIDsInPaylist = append(trackIDsInPaylist, track.ID)
|
||||
}
|
||||
filterTrackIDs = sharedutil.FilterSlice(trackIDs, func(trackID string) bool {
|
||||
return !slices.Contains(trackIDsInPaylist, trackID)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
m.App.ServerManager.Server.AddPlaylistTracks(id, filterTrackIDs)
|
||||
}()
|
||||
} else {
|
||||
go m.App.ServerManager.Server.AddPlaylistTracks(id, trackIDs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
+10
-11
@@ -33,8 +33,8 @@ type SearchDialog struct {
|
||||
list *widget.List
|
||||
selectedIndex int
|
||||
|
||||
placeholderTitle string
|
||||
content *fyne.Container
|
||||
placeholderTitle string
|
||||
content *fyne.Container
|
||||
|
||||
OnDismiss func()
|
||||
OnNavigateTo func(mediaprovider.ContentType, string, string)
|
||||
@@ -142,7 +142,7 @@ func (sd *SearchDialog) setResults(results []*mediaprovider.SearchResult) {
|
||||
|
||||
func (sd *SearchDialog) SetContent(checkBox *widget.Check) {
|
||||
dismissBtn := widget.NewButton("Close", sd.onDismiss)
|
||||
title := widget.NewRichText(&widget.TextSegment{Text:sd.placeholderTitle, Style: util.BoldRichTextStyle})
|
||||
title := widget.NewRichText(&widget.TextSegment{Text: sd.placeholderTitle, Style: util.BoldRichTextStyle})
|
||||
title.Segments[0].(*widget.TextSegment).Style.Alignment = fyne.TextAlignCenter
|
||||
se := sd.SearchEntry.(fyne.CanvasObject)
|
||||
if checkBox != nil {
|
||||
@@ -155,15 +155,14 @@ func (sd *SearchDialog) SetContent(checkBox *widget.Check) {
|
||||
)
|
||||
} else {
|
||||
sd.content = container.NewStack(
|
||||
container.NewBorder(
|
||||
container.NewVBox(title, se),
|
||||
container.NewVBox(widget.NewSeparator(), container.NewHBox(layout.NewSpacer(), dismissBtn)),
|
||||
nil, nil, sd.list),
|
||||
container.NewCenter(sd.loadingDots),
|
||||
)
|
||||
container.NewBorder(
|
||||
container.NewVBox(title, se),
|
||||
container.NewVBox(widget.NewSeparator(), container.NewHBox(layout.NewSpacer(), dismissBtn)),
|
||||
nil, nil, sd.list),
|
||||
container.NewCenter(sd.loadingDots),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func (sd *SearchDialog) onInit() {
|
||||
if sd.OnInit == nil {
|
||||
@@ -180,7 +179,7 @@ func (sd *SearchDialog) onInit() {
|
||||
}
|
||||
sd.SetContent(checkBox)
|
||||
sd.loadingDots.Stop()
|
||||
sd.setResults(results)
|
||||
sd.setResults(results)
|
||||
}
|
||||
|
||||
func (sd *SearchDialog) onSearched(query string) {
|
||||
|
||||
@@ -16,18 +16,18 @@ import (
|
||||
)
|
||||
|
||||
type SelectPlaylist struct {
|
||||
SearchDialog *SearchDialog
|
||||
mp mediaprovider.MediaProvider
|
||||
loggedInUser string
|
||||
allPlaylists []*mediaprovider.Playlist
|
||||
SearchDialog *SearchDialog
|
||||
mp mediaprovider.MediaProvider
|
||||
loggedInUser string
|
||||
allPlaylists []*mediaprovider.Playlist
|
||||
SkipDuplicates bool
|
||||
}
|
||||
|
||||
func NewSelectPlaylistDialog(mp mediaprovider.MediaProvider, im util.ImageFetcher, loggedInUser string) *SelectPlaylist {
|
||||
|
||||
sp := &SelectPlaylist{
|
||||
mp: mp,
|
||||
loggedInUser: loggedInUser,
|
||||
mp: mp,
|
||||
loggedInUser: loggedInUser,
|
||||
SkipDuplicates: false,
|
||||
}
|
||||
sd := NewSearchDialog(
|
||||
|
||||
Reference in New Issue
Block a user