-
I'm doing a bit of scripting and would like to do the above to add daily podcast files to a playlist called "Podcasts" which won’t always be in a fixed position in the list of playlists. I can get the script working using audtool --set-current-playlist but this works with a number not a name/title. My problem arises because I create, delete and reorder playlists a lot; sometimes at random so the number of playlists changes the "Podcasts " playlist isn't always guaranteed to be in a fixed position. It seems to me that, at the moment, the only fixed position playlists that I can reliably address by number are the first (1) and last (via audtool --number-of-playlists). However, the "Podcasts " playlists isn't guaranteed to be the last so effectively the only fixed position is the first (1). This is a touch restrictive so any help gratefully received. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
I'd like to suggest a quick workaround. As there is a pair of set/get comands for a playlist's name ("set-current-playlist-name" and "current-playlist-name"), you could iterate over the number of playlists and check their name for your podcasts playlist. |
Beta Was this translation helpful? Give feedback.
-
Thanks. Looping through the playlists until the name matched gave me the position independent solution I was after. Bit brute force but it works. :-) If anyone wants the script ask here. |
Beta Was this translation helpful? Give feedback.
-
After a bit more testing I can't automate the script. I can write a script that cycles through the playlists and this works just fine when run as a user as either a bash or sh script. When run as a cron job the audtool commands don't run even though it's the user crontab. Obviously, the crontab environment isn't the same as the user environment. I just can't find a way to set the right variables so it can address audtool. Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
Solved! Identified problem as this error:
Solution was to add this to the script file (lost the source):
I ended up with a Bourne shell script not a Bash script as the latter didn't work and I was loosing the will to live. |
Beta Was this translation helpful? Give feedback.
-
Solved! Identified the cronjob problem from this error:
Solution was to add this to the script file:
Source: https://redmine.audacious-media-player.org/boards/1/topics/1581?r=1593#message-1593 I ended up with a Bourne shell script not a Bash script as the latter didn't work and I was loosing the will to live. |
Beta Was this translation helpful? Give feedback.
Solved!
Identified the cronjob problem from this error:
Solution was to add this to the script file:
Source: https://redmine.audacious-media-player.org/boards/1/topics/1581?r=1593#message-1593
I ended up with a Bourne shell script not a Bash script as the latter didn't work and I was loosing the will to live.