PDA

View Full Version : CLI support from plugins?



Fred
2005-08-24, 16:37
Guys,

I've had the request to support internet radio from the CLI. Now
Internet radio as I understand is completely implemented using plug-ins.

One approach, given these plugins are part of the SlimServer main
code, is not to bother too much and just hit or copy paste plugin
code and run it only if plugin is enabled.

Another would be to add CLI support to the plugin infrastructure, and
to have the plugin code be responsible to handle CLI requests for it
(from CLI.pm/Command.pm, I would just need to know $p0, ie. the
command name and the function to call; the function would have to
accept some form of standardized CLI parameter list (hash or array
TBD) and return some form of standardized reply).
The problem with this approach is documentation. Currently the CLI
bible is centralized and here it should not be (unless we do shortcut
it for radio given this is part of the server anyway). The nice way
would be to have some form of "automation" for that.

In any case, an issue is that most plugin code is pretty much tightly
integrated with client buttons and/or HTML stuff; that means quite a
bit of work to extract the features from the UI. For example Picks
has no easy function to get the stream list: it's all integrated into
the HTML code. The second option above would have the small advantage
for me of increasing the likelihood of plugin authors supporting the
effort ;-)

What's your view on this?

Fred

mherger
2005-08-26, 00:44
Fred,

An interesting topic! I've been asked to integrate Biography/Review with
telcanto - no way for me to do so and little chance for its developper
without standardized interface.

> One approach, given these plugins are part of the SlimServer main code,
> is not to bother too much and just hit or copy paste plugin code and run
> it only if plugin is enabled.

Isnogood.

> Another would be to add CLI support to the plugin infrastructure, and to
> have the plugin code be responsible to handle CLI requests for it (from

Much better idea.

> CLI.pm/Command.pm, I would just need to know $p0, ie. the command name
> and the function to call;

We could create a getCLIFunctions which returns a hash containing
functions available, similar to the getFunctions there already is.

> In any case, an issue is that most plugin code is pretty much tightly
> integrated with client buttons and/or HTML stuff; that means quite a bit
> of work to extract the features from the UI. For example Picks has no
> easy function to get the stream list: it's all integrated into the HTML

I think most of the plugins that serve player and web interface in a
similar way (browse genres, streams etc.) should have some unified way to
access the data. Obviously I know about Shoutcast, but Picks seems to be
rather simple, too. It would still need some work, of course, but I think
it is feasible.

> What's your view on this?

Excellent idea!

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)