Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member
    Join Date
    Jun 2006
    Location
    Portland, OR
    Posts
    564

    Clear playlist automatically when player is switched off

    Hello,

    i would like to clear the current playlist of a player automatically, when the the player is switched off.

    Are there any ideas, or is there a plugin that could do this?

    Thanks for any help.
    2 x Squeezebox 3 - 1 x Squeezebox Touch - SSOTS 4.14 - Squeezecenter 7.7.3 - QNAP TS439 Pro (3.6.3) - 4 x 500 GB Hitachi (RAID5)

  2. #2
    Senior Member gharris999's Avatar
    Join Date
    Apr 2005
    Location
    Santa Fe, NM
    Posts
    3,302
    If you are turning the SB off using the IR remote, clearing the playlist is pretty easy. From the now-playing screen, hit "left" and then "+". This clears the playlist in two easy button presses.

    What you are suggesting is certainly doable from within a plugin. If there isn't one out there already that will do this sort of thing, it's not a bad idea for one: being able to associate user-composed CLI requests with subscribe-able SC actions.

  3. #3
    Senior Member gharris999's Avatar
    Join Date
    Apr 2005
    Location
    Santa Fe, NM
    Posts
    3,302
    Actually, you should be able to make KDF's ExecuteScript plugin do exactly what you want. See: http://code.google.com/p/kdfplugins/downloads/list

    You'll need to write a script that sends a CLI request to SqueezeCenter for a "playlist clear". The form of the script will depend on the operating system that you're using on your server.

  4. #4
    Quote Originally Posted by mr_hyde View Post
    i would like to clear the current playlist of a player automatically, when the the player is switched off.
    Just curious -- why?

    There used to be a bug that Squeezeboxes that had previously been playing a Random Mox would turn on & resume playing all on their own. Before that was fixed, I would manually clear the playlist when turning off an SB to be sure that bug wouldn't kick in. What's your reason?
    http://www.tux.org/~peterw/
    Note: The best way to reach me is email or PM, as I don't spend time on the forums.
    Free plugins: AllQuiet Auto Dim/AutoDisplay BlankSaver ContextMenu DenonSerial
    FuzzyTime KidsPlay KitchenTimer PlayLog PowerCenter/BottleRocket SaverSwitcher
    SettingsManager SleepFade StatusFirst SyncOptions VolumeLock

  5. #5
    Senior Member
    Join Date
    Jun 2006
    Location
    Portland, OR
    Posts
    564
    Quote Originally Posted by peterw View Post
    Just curious -- why?

    There used to be a bug that Squeezeboxes that had previously been playing a Random Mox would turn on & resume playing all on their own. Before that was fixed, I would manually clear the playlist when turning off an SB to be sure that bug wouldn't kick in. What's your reason?
    Hi,

    first of all, thanks for the replies.

    Indeed, it is curious. I just wana try something.

    Since i installed MusicIP and Spicefly on my NAS, i observe problems with HDD standby, when i played Music with MusicIP or spicefly enabled. When i switch the SB just off, the NAS does not go into standby. When i disconnect the SB, or switch it to SqueezeNetwork and back, or if i clear the playlist, the NAS goes into standby.

    I already thought about the execute plugin. Nevertheless, up to now i have not really found a tutorial for the cli commands. So i don't know, how to send the command clear playlist to the corresponding player.
    EDI: searched at the wrong place, its locally included in SC :-)


    I know, that this is not the best solution, but it would be a workaround till i found the real root cause.

    One thing i know is, that SC accesses the database frequently, when the HDD does not go into standby. This is not the case, when the playlist is cleared, or the player's connection is interupted for a short time.
    Last edited by mr_hyde; 2009-04-19 at 13:38.
    2 x Squeezebox 3 - 1 x Squeezebox Touch - SSOTS 4.14 - Squeezecenter 7.7.3 - QNAP TS439 Pro (3.6.3) - 4 x 500 GB Hitachi (RAID5)

  6. #6
    Senior Member gharris999's Avatar
    Join Date
    Apr 2005
    Location
    Santa Fe, NM
    Posts
    3,302
    If you can find a binary for netcat for your nas, then your script should look something like this:

    Code:
    #!/bin/sh
    PlayerMAC='00:04:20:10:0A:0B'
    SCIp='127.0.0.1'
    CLIPort='9090'
    
    echo $PlayerMAC playlist clear | nc -w 3 $SCIp $CLIPort
    ..fixing up the $PlayerMAC value with the mac address of your SB3, of course.
    Last edited by gharris999; 2009-04-19 at 13:49.

  7. #7
    Senior Member
    Join Date
    Jun 2006
    Location
    Portland, OR
    Posts
    564
    Quote Originally Posted by gharris999 View Post
    If you can find a binary for netcat for your nas, then your script should look something like this:

    Code:
    #!/bin/sh
    PlayerMAC='00:04:20:10:0A:0B'
    SCIp='127.0.0.1'
    CLIPort='9090'
    
    echo $PlayerMAC playlist clear | nc -w 3 $SCIp $CLIPort
    ..fixing up the $PlayerMAC value with the mac address of your SB3, of course.
    Many thanks, i was just about to write a script, but it did not work :-(

    Now i just tried
    echo $PlayerMAC playlist clear | telnet $SCIp $CLIPort

    which works. A step forward :-)
    2 x Squeezebox 3 - 1 x Squeezebox Touch - SSOTS 4.14 - Squeezecenter 7.7.3 - QNAP TS439 Pro (3.6.3) - 4 x 500 GB Hitachi (RAID5)

  8. #8
    Senior Member
    Join Date
    Jun 2006
    Location
    Portland, OR
    Posts
    564
    Just one more question:

    Is there a possibility to have different scripts for different players, or is it possible to identify the playerid which is responsible for the execution of the script?

    Thanks for your help
    2 x Squeezebox 3 - 1 x Squeezebox Touch - SSOTS 4.14 - Squeezecenter 7.7.3 - QNAP TS439 Pro (3.6.3) - 4 x 500 GB Hitachi (RAID5)

  9. #9
    Quote Originally Posted by mr_hyde View Post
    Is there a possibility to have different scripts for different players, or is it possible to identify the playerid which is responsible for the execution of the script?
    Edit the executescript plugin to pass that info? Convention is to use a Perl var named $client, in which case you'd pass $client->id() to send the MAC addr. Or just fully mod it for your needs and call $client->executeRequest to send the cli command all in Perl instead of invoking an external script.

    It'd be overkill, but you could also use PowerCenter. Give each player a different fake X10 code and write a shell script to invoke instead of 'br' that looks at the args passed by PowerCenter. Only act if PowerCenter is sending an off command, and internally translate the fake X10 code to your MAC address.
    http://www.tux.org/~peterw/
    Note: The best way to reach me is email or PM, as I don't spend time on the forums.
    Free plugins: AllQuiet Auto Dim/AutoDisplay BlankSaver ContextMenu DenonSerial
    FuzzyTime KidsPlay KitchenTimer PlayLog PowerCenter/BottleRocket SaverSwitcher
    SettingsManager SleepFade StatusFirst SyncOptions VolumeLock

  10. #10
    Senior Member
    Join Date
    Jun 2006
    Location
    Portland, OR
    Posts
    564
    Thanks for the feedback.

    There was one thing, i forgott to mention. When i conduct a rescan of the library the NAS also seems to go into standby. This is player independent :-).

    I will try this and then i've got more time to find the real root cause.
    2 x Squeezebox 3 - 1 x Squeezebox Touch - SSOTS 4.14 - Squeezecenter 7.7.3 - QNAP TS439 Pro (3.6.3) - 4 x 500 GB Hitachi (RAID5)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •