Bug 227146

Summary: playlist is not saved when exiting KDE without closing Amarok
Product: [Applications] amarok Reporter: Silver Salonen <silver.salonen>
Component: PlaylistAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: gianogli, karaluh, nhn, null, optiluca, qwertier, stuffcorpse, teo, unnamedrambler
Priority: NOR    
Version: 2.3-GIT   
Target Milestone: ---   
Platform: openSUSE   
OS: Unspecified   
Latest Commit: Version Fixed In: 2.4

Description Silver Salonen 2010-02-16 09:37:16 UTC
Version:           2.2.2 (using KDE 4.4.0)
Installed from:    openSUSE RPMs

1) populate playlist with a dynamic playlist
2) exit KDE without exiting Amarok first
3) login back to KDE
4) Amarok will be started, but with playlist that was saved on the last "correct" exit of Amarok
Comment 1 Kevin Funk 2010-02-18 18:57:58 UTC

*** This bug has been marked as a duplicate of bug 226829 ***
Comment 2 Kevin Funk 2010-02-18 22:33:08 UTC

*** This bug has been marked as a duplicate of bug 170506 ***
Comment 3 Silver Salonen 2010-02-19 07:43:19 UTC
Does it mean that Amarok crashes while exiting KDE?
Comment 4 Myriam Schweingruber 2010-02-19 09:26:19 UTC
well, it probably doesn't have time to write all the settings, not a crash, but KDE shuts down too fast for Amarok to write settings.
Not a duplicate, Kevin...
Comment 5 Sven Krohlas 2010-03-31 12:26:18 UTC
*** Bug 232730 has been marked as a duplicate of this bug. ***
Comment 6 Silver Salonen 2010-03-31 20:38:31 UTC
This bug is not duplicate of 226829 - that is completely different issue.
Comment 7 Myriam Schweingruber 2010-05-29 16:51:43 UTC
Still valid with current git.
Comment 8 Casey Link 2010-05-29 19:19:15 UTC
Seems to me we have 2 options for fixing this:

1) Move saving the playlist further up in the order of stuff thats executed on shutdown

2) Save the playlist more often.. after every change?
Comment 9 Myriam Schweingruber 2010-06-23 13:01:52 UTC
*** Bug 242517 has been marked as a duplicate of this bug. ***
Comment 10 Oleg 2010-06-23 13:28:45 UTC
(In reply to comment #8)
> Seems to me we have 2 options for fixing this:
> 
> 1) Move saving the playlist further up in the order of stuff thats executed on
> shutdown
> 
> 2) Save the playlist more often.. after every change?

On my own, everything is simpler. Amarok should catch SIGTERM from the system (polite request to close) and execute the same function as executed when Amarok is closed manually. I think, the program does many manipulations before its closing, not only saving playlist...
Comment 11 karaluh 2010-07-19 15:59:23 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > Seems to me we have 2 options for fixing this:
> > 
> > 1) Move saving the playlist further up in the order of stuff thats executed 
> > on shutdown
> > 
> > 2) Save the playlist more often.. after every change?
> 
> On my own, everything is simpler. Amarok should catch SIGTERM from the system
> (polite request to close) and execute the same function as executed when
> Amarok is closed manually. I think, the program does many manipulations 
> before its closing, not only saving playlist...

I beleive both, Oleg's and 2nd Casey's solutions should be implemented. When application has something to do on exit, it should catch sigterm and do that before terminating, because user expects, that applications will quit cleanly, when he shuts the computer down. This sollution doesn't cover other cases when this bug is triggered - KDE, xorg and kernel crashes.

This bug also affects "Resume playing on start" setting.
Comment 12 gianogli 2010-09-24 23:56:46 UTC
I can confirm this bug in Debian "testing" (KDE 4.4.5 and Amarok 2.3.1).
But... is this a problem of Amarok or is this a problem of how KDE close (to quickly!) a session?
Sometimes I have a similar problem with iceweasel (Firefox): when I close a KDE session with iceweasel open I have the classic iceweasel error "Well, this is embarassing..." at the next login.
What do you think?
Comment 13 Oleg 2010-09-25 07:18:38 UTC
(In reply to comment #12)
> What do you think?
This is a responsibility of a program first. If it does not catch and handle sigterm it is terminated by unhandled signal sigkill.
I have the same problems with programs: almost any program does not save its state, even if it was closed before exit KDE. This might be KDE's bug, but without correct signal handling KDE can do nothing even if it worked correctly.
Comment 14 optiluca@gmail.com 2010-09-27 17:54:09 UTC
(In reply to comment #8)
> Seems to me we have 2 options for fixing this:
> 
> 1) Move saving the playlist further up in the order of stuff thats executed on
> shutdown
> 
> 2) Save the playlist more often.. after every change?

Where 2 would also fix bug 170506
Comment 15 Myriam Schweingruber 2010-11-09 11:04:08 UTC
This is solved in 2.4-git now. Sty tuned :)