Plug-In to extend the arguments list of an existing CLI command ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AndrewFG
    Senior Member
    • Mar 2008
    • 781

    Plug-In to extend the arguments list of an existing CLI command ??

    The standard CLI supports the following command:
    Code:
    <macAddress> playlist play <url> <title>
    I am toying with writing a (hopefully simple) plug-in to extend this command to accept additional arguments providing metadata for the track, as follows:
    Code:
    <macAddress> playlist play <url> <title> <supportsSeek> <bitRate> <size> <duration> <albumArtUrl> <album> <artist> <genre>
    I think such a plug-in would need to implement initCLI() calling Slim::Control::Request::addDispatch() to register a callback to a parser to handle these extra arguments (??)

    Questions:

    1) Is it possible to override/overload the existing "<macAddress> playlist play" command in such a way, and then fall through onto the inherited existing command to do the pre-existing basic playlist play functionality? i.e. so as to avoid completely re-inventing the wheel. (Or should one rather implement a separate new "<macAddress> my_playlist play" command?)

    2) Is it possible to apply the meta data (<supportsSeek> <bitRate> <size> <duration> <albumArtUrl> <album> <artist> <genre>) to the song object that would thus be added to the playlist? (Or would those values just be overwritten or erased when the player does the actual Http Get to retrieve the song concerned?) And are there any values in my list (e.g. supportsSeek) where this is expressly not possible?

    3) Or (open question) am I missing something entirely ??
    Regards,
    AndrewFG

    Try out Whitebear. The middleware that joins the two worlds of:
    1. UPnP/DLNA media clients and media players, and,
    2. Squeezebox Server and Squeeze Players
    Download it for free here: http://www.whitebear.ch/mediaserver
Working...