From 0bdc991dc87ef927935d371cbac51931dfff951f Mon Sep 17 00:00:00 2001 From: Siiiiinth <60766886+Siiiiinth@users.noreply.github.com> Date: Sat, 3 Jan 2026 19:21:47 +0100 Subject: [PATCH] renamed stopAfterCurrent -> pauseAfterCurrent --- backend/app.go | 4 ++-- backend/cmdlineoptions.go | 24 +++++++++++----------- backend/ipc/api.go | 40 ++++++++++++++++++------------------- backend/ipc/client.go | 4 ++-- backend/ipc/server.go | 6 +++--- backend/playbackengine.go | 8 ++++---- backend/playbackmanager.go | 12 +++++------ res/translations/en.json | 2 +- res/translations/fr.json | 5 ++--- ui/controller/controller.go | 12 +++++------ 10 files changed, 58 insertions(+), 59 deletions(-) diff --git a/backend/app.go b/backend/app.go index dbef621..e23b170 100644 --- a/backend/app.go +++ b/backend/app.go @@ -598,8 +598,8 @@ func (a *App) checkFlagsAndSendIPCMsg(cli *ipc.Client) error { return cli.SeekNext() case *FlagStop: return cli.Stop() - case *FlagStopAfterCurrent: - return cli.StopAfterCurrent() + case *FlagPauseAfterCurrent: + return cli.PauseAfterCurrent() case *FlagShow: return cli.Show() case VolumeCLIArg >= 0: diff --git a/backend/cmdlineoptions.go b/backend/cmdlineoptions.go index 1f968a5..b114276 100644 --- a/backend/cmdlineoptions.go +++ b/backend/cmdlineoptions.go @@ -22,18 +22,18 @@ var ( SearchPlaylistCLIArg string = "" SearchTrackCLIArg string = "" - FlagPlay = flag.Bool("play", false, "unpause or begin playback") - FlagPause = flag.Bool("pause", false, "pause playback") - FlagPlayPause = flag.Bool("play-pause", false, "toggle play/pause state") - FlagPrevious = flag.Bool("previous", false, "seek to previous track or beginning of current") - FlagNext = flag.Bool("next", false, "seek to next track") - FlagStop = flag.Bool("stop", false, "stop playback") - FlagStopAfterCurrent = flag.Bool("stop-after-current", false, "stop playback after current track") - FlagStartMinimized = flag.Bool("start-minimized", false, "start app minimized") - FlagShow = flag.Bool("show", false, "show minimized app") - FlagShuffle = flag.Bool("shuffle", false, "shuffle the tracklist (to be used with either -play-album-by-id or -play-playlist-by-id)") - FlagVersion = flag.Bool("version", false, "print app version and exit") - FlagHelp = flag.Bool("help", false, "print command line options and exit") + FlagPlay = flag.Bool("play", false, "unpause or begin playback") + FlagPause = flag.Bool("pause", false, "pause playback") + FlagPlayPause = flag.Bool("play-pause", false, "toggle play/pause state") + FlagPrevious = flag.Bool("previous", false, "seek to previous track or beginning of current") + FlagNext = flag.Bool("next", false, "seek to next track") + FlagStop = flag.Bool("stop", false, "stop playback") + FlagPauseAfterCurrent = flag.Bool("pause-after-current", false, "pause playback after current track") + FlagStartMinimized = flag.Bool("start-minimized", false, "start app minimized") + FlagShow = flag.Bool("show", false, "show minimized app") + FlagShuffle = flag.Bool("shuffle", false, "shuffle the tracklist (to be used with either -play-album-by-id or -play-playlist-by-id)") + FlagVersion = flag.Bool("version", false, "print app version and exit") + FlagHelp = flag.Bool("help", false, "print command line options and exit") FlagPlayAlbum *bool FlagPlayPlaylist *bool diff --git a/backend/ipc/api.go b/backend/ipc/api.go index db4d636..d52e09a 100644 --- a/backend/ipc/api.go +++ b/backend/ipc/api.go @@ -7,26 +7,26 @@ import ( ) const ( - PingPath = "/ping" - PlayPath = "/transport/play" - PlayAlbumPath = "/transport/play-album" // ?id=&t=&s= - PlayPlaylistPath = "/transport/play-playlist" // ?id=&t=&s= - PlayTrackPath = "/transport/play-track" // ?id= - SearchAlbumPath = "/transport/search-album" // ?s= - SearchPlaylistPath = "/transport/search-playlist" // ?s= - SearchTrackPath = "/transport/search-track" // ?s= - PlayPausePath = "/transport/playpause" - PausePath = "/transport/pause" - StopPath = "/transport/stop" - StopAfterCurrentPath = "/transport/stop-after-current" - PreviousPath = "/transport/previous" - NextPath = "/transport/next" - TimePosPath = "/transport/timepos" // ?s= - SeekByPath = "/transport/seek-by" // ?s=<+/- seconds> - VolumePath = "/volume" // ?v= - VolumeAdjustPath = "/volume/adjust" // ?pct=<+/- percentage> - ShowPath = "/window/show" - QuitPath = "/window/quit" + PingPath = "/ping" + PlayPath = "/transport/play" + PlayAlbumPath = "/transport/play-album" // ?id=&t=&s= + PlayPlaylistPath = "/transport/play-playlist" // ?id=&t=&s= + PlayTrackPath = "/transport/play-track" // ?id= + SearchAlbumPath = "/transport/search-album" // ?s= + SearchPlaylistPath = "/transport/search-playlist" // ?s= + SearchTrackPath = "/transport/search-track" // ?s= + PlayPausePath = "/transport/playpause" + PausePath = "/transport/pause" + StopPath = "/transport/stop" + PauseAfterCurrentPath = "/transport/pause-after-current" + PreviousPath = "/transport/previous" + NextPath = "/transport/next" + TimePosPath = "/transport/timepos" // ?s= + SeekByPath = "/transport/seek-by" // ?s=<+/- seconds> + VolumePath = "/volume" // ?v= + VolumeAdjustPath = "/volume/adjust" // ?pct=<+/- percentage> + ShowPath = "/window/show" + QuitPath = "/window/quit" ) type Response struct { diff --git a/backend/ipc/client.go b/backend/ipc/client.go index ac23e3f..46582eb 100644 --- a/backend/ipc/client.go +++ b/backend/ipc/client.go @@ -83,8 +83,8 @@ func (c *Client) Stop() error { return err } -func (c *Client) StopAfterCurrent() error { - _, err := c.sendRequest(StopAfterCurrentPath) +func (c *Client) PauseAfterCurrent() error { + _, err := c.sendRequest(PauseAfterCurrentPath) return err } diff --git a/backend/ipc/server.go b/backend/ipc/server.go index 77a663b..02b5b03 100644 --- a/backend/ipc/server.go +++ b/backend/ipc/server.go @@ -21,7 +21,7 @@ type PlaybackHandler interface { Continue() SeekBackOrPrevious() SeekNext() - SetStopAfterCurrent(bool) + SetPauseAfterCurrent(bool) SeekSeconds(float64) SeekBySeconds(float64) Volume() int @@ -83,8 +83,8 @@ func (s *serverImpl) createHandler() http.Handler { m.HandleFunc(PausePath, s.makeSimpleEndpointHandler(s.pbHandler.Pause)) m.HandleFunc(PlayPausePath, s.makeSimpleEndpointHandler(s.pbHandler.PlayPause)) m.HandleFunc(StopPath, s.makeSimpleEndpointHandler(s.pbHandler.Stop)) - m.HandleFunc(StopAfterCurrentPath, s.makeSimpleEndpointHandler(func() { - s.pbHandler.SetStopAfterCurrent(true) + m.HandleFunc(PauseAfterCurrentPath, s.makeSimpleEndpointHandler(func() { + s.pbHandler.SetPauseAfterCurrent(true) })) m.HandleFunc(PreviousPath, s.makeSimpleEndpointHandler(s.pbHandler.SeekBackOrPrevious)) m.HandleFunc(NextPath, s.makeSimpleEndpointHandler(s.pbHandler.SeekNext)) diff --git a/backend/playbackengine.go b/backend/playbackengine.go index e870c8f..694b8cf 100644 --- a/backend/playbackengine.go +++ b/backend/playbackengine.go @@ -66,7 +66,7 @@ type playbackEngine struct { isRadio bool loopMode LoopMode - stopAfterCurrent bool // flag to stop playback after current track ends + pauseAfterCurrent bool // flag to pause playback after current track ends // flags for handleOnTrackChange / handleOnStopped callbacks - reset to false in the callbacks wasStopped bool // true iff player was stopped before handleOnTrackChange invocation @@ -337,8 +337,8 @@ func (p *playbackEngine) Stop() error { return p.player.Stop(false) } -func (p *playbackEngine) SetStopAfterCurrent(stopAfterCurrent bool) { - p.stopAfterCurrent = stopAfterCurrent +func (p *playbackEngine) SetPauseAfterCurrent(pauseAfterCurrent bool) { + p.pauseAfterCurrent = pauseAfterCurrent } func (p *playbackEngine) Pause() error { @@ -641,7 +641,7 @@ func (p *playbackEngine) handleOnStopped() { p.alreadyScrobbled = false p.wasStopped = true p.nowPlayingIdx = -1 - p.stopAfterCurrent = false + p.pauseAfterCurrent = false } // to be invoked as soon as the next item in the queue that should play changes diff --git a/backend/playbackmanager.go b/backend/playbackmanager.go index 5055853..7faad32 100644 --- a/backend/playbackmanager.go +++ b/backend/playbackmanager.go @@ -135,9 +135,9 @@ func (p *PlaybackManager) addOnTrackChangeHook() { p.cmdQueue.addCommand(playbackCommand{Type: cmdForceRestartPlayback}) } - if p.engine.stopAfterCurrent { + if p.engine.pauseAfterCurrent { p.Pause() - p.engine.SetStopAfterCurrent(false) + p.engine.SetPauseAfterCurrent(false) } }() } @@ -692,12 +692,12 @@ func (p *PlaybackManager) PlayPause() { } } -func (p *PlaybackManager) SetStopAfterCurrent(stopAfterCurrent bool) { - p.engine.SetStopAfterCurrent(stopAfterCurrent) +func (p *PlaybackManager) SetPauseAfterCurrent(pauseAfterCurrent bool) { + p.engine.SetPauseAfterCurrent(pauseAfterCurrent) } -func (p *PlaybackManager) IsStopAfterCurrent() bool { - return p.engine.stopAfterCurrent +func (p *PlaybackManager) IsPauseAfterCurrent() bool { + return p.engine.pauseAfterCurrent } func (p *PlaybackManager) enqueueAutoplayTracks() { diff --git a/res/translations/en.json b/res/translations/en.json index 064a385..0f84174 100644 --- a/res/translations/en.json +++ b/res/translations/en.json @@ -228,7 +228,7 @@ "Soundtrack": "Soundtrack", "Spoken Word": "Spoken Word", "Startup page": "Startup page", - "Stop after current track": "Stop after current track", + "Pause after current track": "Pause after current track", "Stopped": "Stopped", "Success": "Success", "Successfully created playlist": "Successfully created playlist", diff --git a/res/translations/fr.json b/res/translations/fr.json index 02610a2..1cd6775 100644 --- a/res/translations/fr.json +++ b/res/translations/fr.json @@ -219,7 +219,7 @@ "Soundtrack": "Bande originale", "Spoken Word": "Spoken Word", "Startup page": "Page de démarrage", - "Stop after current track": "Arrêter après la piste en cours", + "Pause after current track": "Arrêter après la piste en cours", "Stopped": "Arrêté", "Success": "Succès", "Support the project": "Soutenir le projet", @@ -283,9 +283,8 @@ "Oct": "Oct", "Nov": "Nov", "Dec": "Déc", - "playlist.addedtracks": { "one": "Une piste ajoutée à la liste de lecture", "other": "{{.trackCount}} pistes ajoutées à la liste de lecture" } -} +} \ No newline at end of file diff --git a/ui/controller/controller.go b/ui/controller/controller.go index 03263b4..65d3729 100644 --- a/ui/controller/controller.go +++ b/ui/controller/controller.go @@ -59,7 +59,7 @@ type Controller struct { popUpQueue *widget.PopUp popUpQueueList *widgets.PlayQueueList - stopAfterCurrent *widget.Check + pauseAfterCurrent *widget.Check popUpQueueLastUsed int64 escapablePopUp fyne.CanvasObject haveModal bool @@ -198,10 +198,10 @@ func (m *Controller) ShowPopUpPlayQueue() { title := widget.NewRichTextWithText(lang.L("Play Queue")) title.Segments[0].(*widget.TextSegment).Style.Alignment = fyne.TextAlignCenter title.Segments[0].(*widget.TextSegment).Style.TextStyle.Bold = true - m.stopAfterCurrent = widget.NewCheck(lang.L("Stop after current track"), func(b bool) { - m.App.PlaybackManager.SetStopAfterCurrent(b) + m.pauseAfterCurrent = widget.NewCheck(lang.L("Pause after current track"), func(b bool) { + m.App.PlaybackManager.SetPauseAfterCurrent(b) }) - bottomRow := container.NewHBox(layout.NewSpacer(), m.stopAfterCurrent) + bottomRow := container.NewHBox(layout.NewSpacer(), m.pauseAfterCurrent) ctr := container.NewBorder(title, bottomRow, nil, nil, container.NewPadded(m.popUpQueueList), ) @@ -231,7 +231,7 @@ func (m *Controller) ShowPopUpPlayQueue() { fynetooltip.DestroyPopUpToolTipLayer(m.popUpQueue) m.popUpQueue = nil m.popUpQueueList = nil - m.stopAfterCurrent = nil + m.pauseAfterCurrent = nil m.popUpQueueLastUsed = 0 t.Stop() return @@ -260,7 +260,7 @@ func (m *Controller) ShowPopUpPlayQueue() { )) pop.Resize(size) popUpQueueList.ScrollToNowPlaying() // must come after resize - m.stopAfterCurrent.SetChecked(m.App.PlaybackManager.IsStopAfterCurrent()) + m.pauseAfterCurrent.SetChecked(m.App.PlaybackManager.IsPauseAfterCurrent()) pop.ShowAtPosition(fyne.NewPos( canvasSize.Width-size.Width-10, canvasSize.Height-size.Height-100,