JohnSwenson;564569 Wrote:
> Looking at the lua code its actually looking at the mounted partitions
> and forcing what goes in the prefs.json to be one of these partitions
> so I'm not sure a mount would work here.
>
> I tried changing the server.prefs file and started up TinySBS, the
> change in the file happened just before the "server starting" spinny
> finished, so its most likely something in the perl code executed very
> late in the startup sequence.
>
If you looked at the server.prefs file and saw when it was written to
disk, please remember that it isn't written to file immediately when a
preferences is changed, so the change might happen earlier than you
think but it's only written to the file later.
However, it seems like a pretty easy fix would be to patch the
_setupMediaDir function in Slim/Utils/OS/SqueezeOS.pm to check if there
is a specific sub dir on the path specified on input and use that sub
directory as the audiodir if it exists. If the sub directory doesn't
exist it should instead use the main dir on the mounted device. The sub
directory can be stored in a standard server preferences which can be
entered from a simple SqueezePlay applet. The applet can either use the
CLI "pref" command to write it to the server or as an alternative
generate another json file which is read in _setupMediaDir to get the
configured sub directory.
If I've interpreted the code correctly, the setupMediaDir code should
execute when slimserver.pl calls its initSettings function, this
happens in the beginning of the server startup. Theoretically, this
might open up for a solution where a plugin could read the "audiodir"
preference at startup, check if a specific sub directory exists under
the configured "audiodir" and change "audiodir" if it does. Plugins
seems to be initialized before the auto scanning is initiated, it might
work to execute this code in the initPlugin method in the plugin. The
problem with this is just that changing the audiodir will trigger the
_setupMediaDir function and I'm not completely sure it will work
correctly with a directory that isn't directly below /media and exactly
matches a mounted device.
John, have you seen any other places in the server code where the
"audiodir" preferences is changed beside the above _setupMediaDir
function ?
Anyway, I just wanted to post some ideas in case someone wants to make
a try at creating a patch for this. Everything under /usr is patchable
by patches provided through the Patch Installer applet, so patching the
above mentioned file should be possible.
--
erland
Erland Isaksson ('My homepage' (http://erland.isaksson.info))
(Developer of 'many plugins/applets'
(http://wiki.slimdevices.com/index.php/User:Erland). If my answer
helped you and you like to encourage future presence on this forum
and/or third party plugin/applet development, 'donations are always
appreciated' (http://erland.isaksson.info/donate))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=80676
_______________________________________________
Touch mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/touch