
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
An amarok script that monitors the playlist, and, when it's finished, repopulates it with a random album from the collection. Differently from amarok's built-in "random album" mode, you don't need to keep the whole collection in the playlist; so when you add new stuff to the collection the script will automatically pick it up, and it's easy to manually enqueue songs into the current playlist without the "random mode" triggering whenever the current album finishes playing.
This script is inspired and very loosely based on the randomalbum.py script for amarok 1.4, available at the following URL:
http://www.kde-apps.org/content/show.php?content=42764
9 years ago
* Version 1.0:
. some tweaking to the monitoring code to make the script behave better in amarok 2.4.
* Version 0.9:
. monitor track changes, so that skipping the last track on a playlist will also make the script load a new album. Suggested by kronos003 (irc.freenode.net).
* Version 0.8:
. add support for genre filtering (contributed by Ghislain Mary)
* Version 0.7:
. minor update to work around an issue where playback wouldn't start when loading a new album. Delay the start of the playback a little to let amarok's UI properly refresh.
* Version 0.6:
. persist the list of played albums so that the same album isn't played after restarting amarok.
. if running in amarok 2.3.1, respect the "stop playing after current track" setting.
* Version 0.5:
. fix an issue with path filtering not doing what it was supposed to do in some cases
. remove some code that caused the script to freak out when stopping playback when the last track of a playlist was active.
* Version 0.4:
. Reworked the SQL queries; they should work better on databases that did not look like mine.
. Added option to filter the albums being loaded according to a string (matched against the album path).
* Version 0.3:
. Add new action to enable / disable the playlist monitor.
* Version 0.2:
. Updated to work with amarok 2.1. Hasn't been tested with 2.0.2...
* Version 0.1:
Initial version. What works:
. loading and enqueueing a random album.
Known issues:
. the playlist sometimes doesn't repaint correctly after an update. Clicking somewhere on the playlist fixes it (looks like an Amarok problem).
. only tested on my setup, so I don't know how it will work with collections spanning different devices, etc.
9 years ago
* Version 1.0:
. some tweaking to the monitoring code to make the script behave better in amarok 2.4.
* Version 0.9:
. monitor track changes, so that skipping the last track on a playlist will also make the script load a new album. Suggested by kronos003 (irc.freenode.net).
* Version 0.8:
. add support for genre filtering (contributed by Ghislain Mary)
* Version 0.7:
. minor update to work around an issue where playback wouldn't start when loading a new album. Delay the start of the playback a little to let amarok's UI properly refresh.
* Version 0.6:
. persist the list of played albums so that the same album isn't played after restarting amarok.
. if running in amarok 2.3.1, respect the "stop playing after current track" setting.
* Version 0.5:
. fix an issue with path filtering not doing what it was supposed to do in some cases
. remove some code that caused the script to freak out when stopping playback when the last track of a playlist was active.
* Version 0.4:
. Reworked the SQL queries; they should work better on databases that did not look like mine.
. Added option to filter the albums being loaded according to a string (matched against the album path).
* Version 0.3:
. Add new action to enable / disable the playlist monitor.
* Version 0.2:
. Updated to work with amarok 2.1. Hasn't been tested with 2.0.2...
* Version 0.1:
Initial version. What works:
. loading and enqueueing a random album.
Known issues:
. the playlist sometimes doesn't repaint correctly after an update. Clicking somewhere on the playlist fixes it (looks like an Amarok problem).
. only tested on my setup, so I don't know how it will work with collections spanning different devices, etc.
mvanzin
11 years ago
I'll look at adding an easier way to stop the script.
Report
jajaxor
11 years ago
Report
skiron
11 years ago
First of all, thank you for updating the old amaroK 1.4 script to amaroK 2.
I really like this feature, and in my opinion, it should be built in amaroK.
And I'm sorry to come with bad news... But once installed and enabled, when the last title in the playlist is finished, amaroK goes crazy: it loads a new album and in the milliseconds after it erases the playlist and loads another album an so on for 20 to 40 seconds. It changes album so fast that the "current played title" info (in the middle panel) has no time to refresh to every new title. At the end, one title is finally played, but the playlist is empty (there is even no the current played title).
I really love to have this script working, so if you need any test, don't hesitate to ask !!
I'm running on Kubuntu 9.04 - amaroK 2.0.1
(I've got a log of the execution, but it's quite big, so I won't post it here, but if you need it, just ask ;-) )
Report
mvanzin
11 years ago
In any case, you can send the output to my e-mail (it's at the top of the script's main.js) so I can see if someone interesting pops up.
One thing you can try is to increase the delay between detecting the end of the playlist and replacing it; on line 199 of main.js, change:
timer.start(10);
To:
timer.start(200);
(Or some other value.) Without this timer Amarok got really confused when the script ran, so maybe something similar is happening in your case.
Report
skiron
11 years ago
So I simply updgraded to amarok 2.0.2, and now it works just as it should !!!
Thanks for your answer!!
I would like now to ask for an improvement:
it would be wonderful if one can choose the type of the new album loaded. For example, I would like that the new album has the same genre (style) that the one just played. But it could be the same artist or the same year...
Report