From 6ea349949174abac7638506b04355d4143930e29 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Wed, 17 Sep 2025 08:55:35 -0700 Subject: [PATCH 1/5] add 'New Playlist' button to Playlists page --- .../jellyfin/jellyfinmediaprovider.go | 7 +++- backend/mediaprovider/mediaprovider.go | 4 +- .../subsonic/subsonicmediaprovider.go | 23 ++++++++++- go.mod | 2 +- go.sum | 4 +- ui/browsing/playlistspage.go | 27 +++++++++---- ui/controller/playlist.go | 39 ++++++++++++++++++- ui/dialogs/editplaylistdialog.go | 18 +++++++-- 8 files changed, 104 insertions(+), 20 deletions(-) diff --git a/backend/mediaprovider/jellyfin/jellyfinmediaprovider.go b/backend/mediaprovider/jellyfin/jellyfinmediaprovider.go index 4e47a11..6a60460 100644 --- a/backend/mediaprovider/jellyfin/jellyfinmediaprovider.go +++ b/backend/mediaprovider/jellyfin/jellyfinmediaprovider.go @@ -1,6 +1,7 @@ package jellyfin import ( + "errors" "image" "io" "math" @@ -77,7 +78,7 @@ func (j *jellyfinMediaProvider) SetLibrary(id string) error { return nil } -func (j *jellyfinMediaProvider) CreatePlaylist(name string, trackIDs []string) error { +func (j *jellyfinMediaProvider) CreatePlaylistWithTracks(name string, trackIDs []string) error { return j.client.CreatePlaylist(name, trackIDs) } @@ -93,6 +94,10 @@ func (j *jellyfinMediaProvider) EditPlaylist(id, name, description string, publi return j.client.UpdatePlaylistMetadata(id, name, description) } +func (j *jellyfinMediaProvider) CreatePlaylist(name, description string, public bool) error { + return errors.New("unimplemented") +} + func (j *jellyfinMediaProvider) AddPlaylistTracks(id string, trackIDsToAdd []string) error { return j.client.AddSongsToPlaylist(id, trackIDsToAdd) } diff --git a/backend/mediaprovider/mediaprovider.go b/backend/mediaprovider/mediaprovider.go index 5fa2c48..8ce6b64 100644 --- a/backend/mediaprovider/mediaprovider.go +++ b/backend/mediaprovider/mediaprovider.go @@ -256,10 +256,12 @@ type MediaProvider interface { GetPlaylists() ([]*Playlist, error) - CreatePlaylist(name string, trackIDs []string) error + CreatePlaylistWithTracks(name string, trackIDs []string) error CanMakePublicPlaylist() bool + CreatePlaylist(name, description string, public bool) error + EditPlaylist(id, name, description string, public bool) error AddPlaylistTracks(id string, trackIDsToAdd []string) error diff --git a/backend/mediaprovider/subsonic/subsonicmediaprovider.go b/backend/mediaprovider/subsonic/subsonicmediaprovider.go index 478ac5a..6c83461 100644 --- a/backend/mediaprovider/subsonic/subsonicmediaprovider.go +++ b/backend/mediaprovider/subsonic/subsonicmediaprovider.go @@ -62,11 +62,32 @@ func (s *subsonicMediaProvider) SetLibrary(id string) error { return nil } -func (s *subsonicMediaProvider) CreatePlaylist(name string, trackIDs []string) error { +func (s *subsonicMediaProvider) CreatePlaylistWithTracks(name string, trackIDs []string) error { s.playlistsCached = nil return s.client.CreatePlaylistWithTracks(trackIDs, map[string]string{"name": name}) } +func (s *subsonicMediaProvider) CreatePlaylist(name, description string, public bool) error { + pl, err := s.client.CreatePlaylist(map[string]string{"name": name}) + if err != nil { + return err + } + if pl == nil || (description == "" && !public) { + // Subsonic <= 1.14.0 doesn't return a playlist + // Not having the ID, we can't set the description or public property + return nil + } + + params := make(map[string]string) + if description != "" { + params["description"] = description + } + if public { + params["public"] = "true" + } + return s.client.UpdatePlaylist(pl.ID, params) +} + func (s *subsonicMediaProvider) DeletePlaylist(id string) error { s.playlistsCached = nil return s.client.DeletePlaylist(id) diff --git a/go.mod b/go.mod index f0d0833..9ddfe03 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/quarckster/go-mpris-server v1.0.3 github.com/supersonic-app/fyne-lyrics v0.0.0-20250614151306-b1880a70a410 github.com/supersonic-app/go-mpv v0.1.1-0.20250822102843-7a8cde5f5449 - github.com/supersonic-app/go-subsonic v0.0.0-20250913173646-cf4fceb19b43 + github.com/supersonic-app/go-subsonic v0.0.0-20250917154259-2bbe535cf8f3 github.com/supersonic-app/go-upnpcast v0.0.0-20250330154256-b957204209a5 github.com/zalando/go-keyring v0.2.6 golang.org/x/net v0.38.0 diff --git a/go.sum b/go.sum index b85fb41..00193bb 100644 --- a/go.sum +++ b/go.sum @@ -132,8 +132,8 @@ github.com/supersonic-app/go-glfw/v3.3/glfw v0.0.0-20250906235349-c09e5a2f6b75 h github.com/supersonic-app/go-glfw/v3.3/glfw v0.0.0-20250906235349-c09e5a2f6b75/go.mod h1:SyRD8YfuKk+ZXlDqYiqe1qMSqjNgtHzBTG810KUagMc= github.com/supersonic-app/go-mpv v0.1.1-0.20250822102843-7a8cde5f5449 h1:UHIPI43VzyWuIF8z8WVMdjMsC/orZTZQJraD/Iv+ghw= github.com/supersonic-app/go-mpv v0.1.1-0.20250822102843-7a8cde5f5449/go.mod h1:1bQz6kBQumJopXEbkiqoLxIXLy7F7yWFBvknvpAtIC0= -github.com/supersonic-app/go-subsonic v0.0.0-20250913173646-cf4fceb19b43 h1:Ds3zznwB8v2EowUg+GPk2y+IDzUAujv522EN8H6XNdk= -github.com/supersonic-app/go-subsonic v0.0.0-20250913173646-cf4fceb19b43/go.mod h1:ClhAgC2qobwH19D6kdwULLYSHlOmldDGkdu2G2Z0Ijo= +github.com/supersonic-app/go-subsonic v0.0.0-20250917154259-2bbe535cf8f3 h1:RuCWkkDc0THP9Y5wbPG8q0Or5zT5cxfLdVzznX+hXbA= +github.com/supersonic-app/go-subsonic v0.0.0-20250917154259-2bbe535cf8f3/go.mod h1:ClhAgC2qobwH19D6kdwULLYSHlOmldDGkdu2G2Z0Ijo= github.com/supersonic-app/go-upnpcast v0.0.0-20250330154256-b957204209a5 h1:aoUJKPFD/ZrNZjK6fl2Xhazwsttx42esKxhSSzEE3Bo= github.com/supersonic-app/go-upnpcast v0.0.0-20250330154256-b957204209a5/go.mod h1:ibt19zDV5/vvF14jHJpTv3AOorq1EbmrMAubxnuvR5Y= github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= diff --git a/ui/browsing/playlistspage.go b/ui/browsing/playlistspage.go index 5bea3b5..824fd67 100644 --- a/ui/browsing/playlistspage.go +++ b/ui/browsing/playlistspage.go @@ -36,6 +36,7 @@ type PlaylistsPage struct { searchedPlaylists []*mediaprovider.Playlist viewToggle *widgets.ToggleButtonGroup + newBtn *widget.Button searcher *widgets.SearchEntry titleDisp *widget.RichText container *fyne.Container @@ -86,6 +87,9 @@ func newPlaylistsPage( widget.NewButtonWithIcon("", theme.NewThemedResource(res.ResListSvg), a.showListView), widget.NewButtonWithIcon("", theme.NewThemedResource(res.ResGridSvg), a.showGridView)) a.viewToggle.SetActivatedButton(activeView) + a.newBtn = widget.NewButtonWithIcon(lang.L("New Playlist"), theme.ContentAddIcon(), func() { + a.contr.DoCreatePlaylistWorkflow() + }) if activeView == 0 { a.createListView() a.buildContainer(a.listView) @@ -98,6 +102,21 @@ func newPlaylistsPage( return a } +func (a *PlaylistsPage) buildContainer(initialView fyne.CanvasObject) { + searchVbox := container.NewVBox(layout.NewSpacer(), a.searcher, layout.NewSpacer()) + a.container = container.New(&layout.CustomPaddedLayout{LeftPadding: 15, RightPadding: 15, TopPadding: 5, BottomPadding: 15}, + container.NewBorder( + container.NewHBox( + a.titleDisp, + container.NewCenter(a.viewToggle), + util.NewHSpace(2), + container.NewCenter(a.newBtn), + layout.NewSpacer(), + searchVbox, + ), + nil, nil, nil, initialView)) +} + var _ Scrollable = (*PlaylistsPage)(nil) func (p *PlaylistsPage) Scroll(scrollAmt float32) { @@ -317,14 +336,6 @@ func (s *savedPlaylistsPage) Restore() Page { return newPlaylistsPage(s.contr, s.pool, s.cfg, s.mp, s.searchText, s.activeView, s.listSort, s.listScrollPos, s.gridScrollPos) } -func (a *PlaylistsPage) buildContainer(initialView fyne.CanvasObject) { - searchVbox := container.NewVBox(layout.NewSpacer(), a.searcher, layout.NewSpacer()) - a.container = container.New(&layout.CustomPaddedLayout{LeftPadding: 15, RightPadding: 15, TopPadding: 5, BottomPadding: 15}, - container.NewBorder( - container.NewHBox(a.titleDisp, container.NewCenter(a.viewToggle), layout.NewSpacer(), searchVbox), - nil, nil, nil, initialView)) -} - func (a *PlaylistsPage) CreateRenderer() fyne.WidgetRenderer { return widget.NewSimpleRenderer(a.container) } diff --git a/ui/controller/playlist.go b/ui/controller/playlist.go index eec2698..04de858 100644 --- a/ui/controller/playlist.go +++ b/ui/controller/playlist.go @@ -43,7 +43,7 @@ func (m *Controller) DoAddTracksToPlaylistWorkflow(trackIDs []string) { m.App.Config.Application.AddToPlaylistSkipDuplicates = sp.SkipDuplicates if id == "" /* creating new playlist */ { go func() { - err := m.App.ServerManager.Server.CreatePlaylist(sp.SearchDialog.SearchQuery(), trackIDs) + err := m.App.ServerManager.Server.CreatePlaylistWithTracks(sp.SearchDialog.SearchQuery(), trackIDs) if err == nil { notifySuccess(len(trackIDs)) } else { @@ -132,8 +132,13 @@ func (m *Controller) DoEditPlaylistWorkflow(playlist *mediaprovider.Playlist) { pop.Hide() m.doModalClosed() go func() { - err := m.App.ServerManager.Server.EditPlaylist(playlist.ID, dlg.Name, dlg.Description, dlg.IsPublic) + s := m.App.ServerManager.GetServer() + if s == nil { + return // logged out + } + err := s.EditPlaylist(playlist.ID, dlg.Name, dlg.Description, dlg.IsPublic) if err != nil { + fyne.Do(func() { m.ToastProvider.ShowErrorToast(lang.L("Error updating playlist")) }) log.Printf("error updating playlist: %s", err.Error()) } else if rte := m.CurPageFunc(); rte.Page == Playlist && rte.Arg == playlist.ID { // if user is on playlist page, reload to get the updates @@ -144,3 +149,33 @@ func (m *Controller) DoEditPlaylistWorkflow(playlist *mediaprovider.Playlist) { m.haveModal = true pop.Show() } + +func (m *Controller) DoCreatePlaylistWorkflow() { + canMakePublic := m.App.ServerManager.Server.CanMakePublicPlaylist() + dlg := dialogs.NewCreatePlaylistDialog(canMakePublic) + pop := widget.NewModalPopUp(dlg, m.MainWindow.Canvas()) + m.ClosePopUpOnEscape(pop) + dlg.OnCanceled = func() { + pop.Hide() + m.doModalClosed() + } + dlg.OnUpdateMetadata = func() { + pop.Hide() + m.doModalClosed() + go func() { + s := m.App.ServerManager.GetServer() + if s == nil { + return // logged out + } + err := s.CreatePlaylist(dlg.Name, dlg.Description, dlg.IsPublic) + if err != nil { + fyne.Do(func() { m.ToastProvider.ShowErrorToast(lang.L("Error creating playlist")) }) + log.Printf("error creating playlist: %s", err.Error()) + } else { + fyne.Do(func() { m.ToastProvider.ShowSuccessToast(lang.L("Successfully created playlist")) }) + } + }() + } + m.haveModal = true + pop.Show() +} diff --git a/ui/dialogs/editplaylistdialog.go b/ui/dialogs/editplaylistdialog.go index 72812fe..7d0f07d 100644 --- a/ui/dialogs/editplaylistdialog.go +++ b/ui/dialogs/editplaylistdialog.go @@ -26,10 +26,19 @@ type EditPlaylistDialog struct { } func NewEditPlaylistDialog(playlist *mediaprovider.Playlist, showPublicCheck bool) *EditPlaylistDialog { - e := &EditPlaylistDialog{ - IsPublic: playlist.Public, - Name: playlist.Name, - Description: playlist.Description, + return newEditPlaylistDialog(playlist, showPublicCheck) +} + +func NewCreatePlaylistDialog(showPublicCheck bool) *EditPlaylistDialog { + return newEditPlaylistDialog(nil, showPublicCheck) +} + +func newEditPlaylistDialog(playlist *mediaprovider.Playlist, showPublicCheck bool) *EditPlaylistDialog { + e := &EditPlaylistDialog{} + if playlist != nil { + e.IsPublic = playlist.Public + e.Name = playlist.Name + e.Description = playlist.Description } e.ExtendBaseWidget(e) @@ -42,6 +51,7 @@ func NewEditPlaylistDialog(playlist *mediaprovider.Playlist, showPublicCheck boo e.OnDeletePlaylist() } }) + deleteBtn.Hidden = playlist == nil submitBtn := widget.NewButtonWithIcon(lang.L("OK"), theme.ConfirmIcon(), func() { if e.OnUpdateMetadata != nil { e.OnUpdateMetadata() From a55b7216d56053b0f07e84c323fa9165deec775d Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Mon, 22 Sep 2025 17:22:43 -0700 Subject: [PATCH 2/5] implement CreatePlaylist button for jellyfin --- backend/mediaprovider/jellyfin/jellyfinmediaprovider.go | 7 +++---- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/mediaprovider/jellyfin/jellyfinmediaprovider.go b/backend/mediaprovider/jellyfin/jellyfinmediaprovider.go index 6a60460..d67216c 100644 --- a/backend/mediaprovider/jellyfin/jellyfinmediaprovider.go +++ b/backend/mediaprovider/jellyfin/jellyfinmediaprovider.go @@ -1,7 +1,6 @@ package jellyfin import ( - "errors" "image" "io" "math" @@ -79,7 +78,7 @@ func (j *jellyfinMediaProvider) SetLibrary(id string) error { } func (j *jellyfinMediaProvider) CreatePlaylistWithTracks(name string, trackIDs []string) error { - return j.client.CreatePlaylist(name, trackIDs) + return j.client.CreatePlaylist(name, "", false, trackIDs) } func (j *jellyfinMediaProvider) DeletePlaylist(id string) error { @@ -91,11 +90,11 @@ func (j *jellyfinMediaProvider) CanMakePublicPlaylist() bool { } func (j *jellyfinMediaProvider) EditPlaylist(id, name, description string, public bool) error { - return j.client.UpdatePlaylistMetadata(id, name, description) + return j.client.UpdatePlaylistMetadata(id, name, description, false) } func (j *jellyfinMediaProvider) CreatePlaylist(name, description string, public bool) error { - return errors.New("unimplemented") + return j.client.CreatePlaylist(name, description, public, nil) } func (j *jellyfinMediaProvider) AddPlaylistTracks(id string, trackIDsToAdd []string) error { diff --git a/go.mod b/go.mod index 9ddfe03..ddcd524 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/deluan/sanitize v0.0.0-20230310221930-6e18967d9fc1 github.com/dweymouth/fyne-advanced-list v0.0.0-20250211191927-58ea85eec72c github.com/dweymouth/fyne-tooltip v0.3.0 - github.com/dweymouth/go-jellyfin v0.0.0-20250914000657-c172d6f678bb + github.com/dweymouth/go-jellyfin v0.0.0-20250923002019-77408ca7bfed github.com/go-audio/audio v1.0.0 github.com/go-audio/wav v1.1.0 github.com/godbus/dbus/v5 v5.1.0 diff --git a/go.sum b/go.sum index 00193bb..087afa2 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/dweymouth/fyne-tooltip v0.3.0 h1:NKCyTkh9NtvnTsiHtTOtaJzRDOFYP8AckQ2t github.com/dweymouth/fyne-tooltip v0.3.0/go.mod h1:m04ShLW/Tp6LXrNieTumApvNgo7YSB+wi+jZTN+kDBU= github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250712002006-5064d705dac4 h1:Q3r94AcVL8yaF4Nrd3EQFKyLL3UN/zHPkj+My9B2vCQ= github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250712002006-5064d705dac4/go.mod h1:YZt7SksjvrSNJCwbWFV32WON3mE1Sr7L41D29qMZ/lU= -github.com/dweymouth/go-jellyfin v0.0.0-20250914000657-c172d6f678bb h1:KNCB0eDnrT81L5Up6y5jp91fnih3Yh6l1+vYy7JicEE= -github.com/dweymouth/go-jellyfin v0.0.0-20250914000657-c172d6f678bb/go.mod h1:fcUagHBaQnt06GmBAllNE0J4O/7064zXRWdqnTTtVjI= +github.com/dweymouth/go-jellyfin v0.0.0-20250923002019-77408ca7bfed h1:XiU6491cgNOb8bGerKvPhcOBMHJiFz1UQbRvzy6Guws= +github.com/dweymouth/go-jellyfin v0.0.0-20250923002019-77408ca7bfed/go.mod h1:fcUagHBaQnt06GmBAllNE0J4O/7064zXRWdqnTTtVjI= github.com/dweymouth/go-wav v0.0.0-20250719173115-e60429a83eb0 h1:mYcctuWgVArHhSLJxndlUM43C3hoE18BLDBkXKM2tl0= github.com/dweymouth/go-wav v0.0.0-20250719173115-e60429a83eb0/go.mod h1:bp2870jtp/ixAJLIOdShBfl1WpyLGDZ57jnVWMgkgIc= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= From f830235f941223a88353ffd92e8f3cc32b25c9ad Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Mon, 22 Sep 2025 17:29:36 -0700 Subject: [PATCH 3/5] add i18n for EN and ES --- res/translations/en.json | 3 +++ res/translations/es.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/res/translations/en.json b/res/translations/en.json index 73fd979..e53c170 100644 --- a/res/translations/en.json +++ b/res/translations/en.json @@ -88,6 +88,7 @@ "EPs": "EPs", "Equalizer": "Equalizer", "Error": "Error", + "Error creating playlist": "Error creating playlist", "Exclusive mode": "Exclusive mode", "Favorites": "Favorites", "Field Recording": "Field Recording", @@ -131,6 +132,7 @@ "My Server": "My Server", "Name": "Name", "Name (A-Z)": "Name (A-Z)", + "New Playlist": "New Playlist", "Next": "Next", "Nickname": "Nickname", "Normal": "Normal", @@ -221,6 +223,7 @@ "Stop after current track": "Stop after current track", "Stopped": "Stopped", "Success": "Success", + "Successfully created playlist": "Successfully created playlist", "Support the project": "Support the project", "Switch Servers": "Switch Servers", "Testing connection": "Testing connection", diff --git a/res/translations/es.json b/res/translations/es.json index 12b5883..2747300 100644 --- a/res/translations/es.json +++ b/res/translations/es.json @@ -73,6 +73,7 @@ "EPs": "EPs", "Equalizer": "Ecualizador", "Error": "Error", + "Error creating playlist": "Ha ocurrido un error al crear la lista de reproducción", "Exclusive mode": "Modo exclusivo", "Favorites": "Favoritos", "Field Recording": "Grabación en campo", @@ -113,6 +114,7 @@ "My Server": "Mi servidor", "Name": "Nombre", "Name (A-Z)": "Nombre (A-Z)", + "New Playlist": "Crear Nueva", "Next": "Siguiente", "Nickname": "Apodo", "Now Playing": "Reproduciendo", @@ -193,6 +195,7 @@ "Startup page": "Página de inicio", "Stopped": "Detenida", "Success": "Éxito", + "Successfully created playlist": "Éxito al crear la lista de reproducción", "Support the project": "Apoya el proyecto", "Switch Servers": "Cambiar servidores", "Testing connection": "Probando conexión", From 47603b1610cb23c85dd5b70ccdeb76bd3fcf0b7d Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Sun, 28 Sep 2025 15:34:55 -0700 Subject: [PATCH 4/5] update go-jellyfin for create playlist with description fix --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 984bfbe..51856e7 100644 --- a/go.mod +++ b/go.mod @@ -7,10 +7,11 @@ require ( github.com/20after4/configdir v0.1.1 github.com/Microsoft/go-winio v0.6.2 github.com/cenkalti/dominantcolor v1.0.3 + github.com/charlievieth/strcase v0.0.5 github.com/deluan/sanitize v0.0.0-20230310221930-6e18967d9fc1 github.com/dweymouth/fyne-advanced-list v0.0.0-20250211191927-58ea85eec72c github.com/dweymouth/fyne-tooltip v0.3.0 - github.com/dweymouth/go-jellyfin v0.0.0-20250923002019-77408ca7bfed + github.com/dweymouth/go-jellyfin v0.0.0-20250928223159-bd2fb9681ef5 github.com/go-audio/audio v1.0.0 github.com/go-audio/wav v1.1.0 github.com/godbus/dbus/v5 v5.1.0 @@ -33,7 +34,6 @@ require ( al.essio.dev/pkg/shellescape v1.5.1 // indirect fyne.io/systray v1.11.0 // indirect github.com/BurntSushi/toml v1.4.0 // indirect - github.com/charlievieth/strcase v0.0.5 // indirect github.com/danieljoos/wincred v1.2.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fogleman/gg v1.3.0 // indirect diff --git a/go.sum b/go.sum index 5b78c55..37d11ea 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ github.com/dweymouth/fyne-tooltip v0.3.0 h1:NKCyTkh9NtvnTsiHtTOtaJzRDOFYP8AckQ2t github.com/dweymouth/fyne-tooltip v0.3.0/go.mod h1:m04ShLW/Tp6LXrNieTumApvNgo7YSB+wi+jZTN+kDBU= github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250712002006-5064d705dac4 h1:Q3r94AcVL8yaF4Nrd3EQFKyLL3UN/zHPkj+My9B2vCQ= github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250712002006-5064d705dac4/go.mod h1:YZt7SksjvrSNJCwbWFV32WON3mE1Sr7L41D29qMZ/lU= -github.com/dweymouth/go-jellyfin v0.0.0-20250923002019-77408ca7bfed h1:XiU6491cgNOb8bGerKvPhcOBMHJiFz1UQbRvzy6Guws= -github.com/dweymouth/go-jellyfin v0.0.0-20250923002019-77408ca7bfed/go.mod h1:fcUagHBaQnt06GmBAllNE0J4O/7064zXRWdqnTTtVjI= +github.com/dweymouth/go-jellyfin v0.0.0-20250928223159-bd2fb9681ef5 h1:Or5VJodg7cGmdnBIcS+FrEH0twBi7mZsFCz6V0vCOQI= +github.com/dweymouth/go-jellyfin v0.0.0-20250928223159-bd2fb9681ef5/go.mod h1:fcUagHBaQnt06GmBAllNE0J4O/7064zXRWdqnTTtVjI= github.com/dweymouth/go-wav v0.0.0-20250719173115-e60429a83eb0 h1:mYcctuWgVArHhSLJxndlUM43C3hoE18BLDBkXKM2tl0= github.com/dweymouth/go-wav v0.0.0-20250719173115-e60429a83eb0/go.mod h1:bp2870jtp/ixAJLIOdShBfl1WpyLGDZ57jnVWMgkgIc= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= From 041818bb93721785894b4689db7d5f39b10dbfc7 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Sun, 28 Sep 2025 15:44:05 -0700 Subject: [PATCH 5/5] ui fixes --- ui/controller/playlist.go | 7 ++++++- ui/dialogs/editplaylistdialog.go | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ui/controller/playlist.go b/ui/controller/playlist.go index ae58f48..31e5f98 100644 --- a/ui/controller/playlist.go +++ b/ui/controller/playlist.go @@ -171,7 +171,12 @@ func (m *Controller) DoCreatePlaylistWorkflow() { fyne.Do(func() { m.ToastProvider.ShowErrorToast(lang.L("Error creating playlist")) }) log.Printf("error creating playlist: %s", err.Error()) } else { - fyne.Do(func() { m.ToastProvider.ShowSuccessToast(lang.L("Successfully created playlist")) }) + fyne.Do(func() { + // Right now, this workflow is only initiated by the "New Playlist" button + // on the playlists page. Reload it so the new playlist shows up. + m.ReloadFunc() + m.ToastProvider.ShowSuccessToast(lang.L("Successfully created playlist")) + }) } }() } diff --git a/ui/dialogs/editplaylistdialog.go b/ui/dialogs/editplaylistdialog.go index 7d0f07d..28cc465 100644 --- a/ui/dialogs/editplaylistdialog.go +++ b/ui/dialogs/editplaylistdialog.go @@ -64,7 +64,14 @@ func newEditPlaylistDialog(playlist *mediaprovider.Playlist, showPublicCheck boo } }) - title := widget.NewLabel(lang.L("Edit Playlist")) + var titleStr string + if playlist == nil { + titleStr = lang.L("New Playlist") + } else { + titleStr = lang.L("Edit Playlist") + } + + title := widget.NewLabel(titleStr) title.Alignment = fyne.TextAlignCenter title.TextStyle.Bold = true e.container = container.NewVBox(