Quantcast
Channel: Squeezebox : Community : Forums - Logitech Media Server
Viewing all articles
Browse latest Browse all 5300

A "Quick and dirty" way to switch between two different music libraries

$
0
0
For the many people that have been asking if it is possible to use multiple libraries on LMS without installing extra plug-ins here is a quick solution. I have had it running for few months now and it works really fine. I use it to switch between two libraries (mine and my wife). The reason to do this is that I am running my LMS on a fanless win7 server with very small CPU capacity (a VIA CPU @ 600MHz!) and unfortunately installing and running Erlands plug-in slows the server down to being unusable.

So here is what I have done and I have only tested it on a WIndows 7 server with LMS ver. 7.7.2.

On Windows 7 the LMS library database and settings file are located under: C:\ProgramData\Squeezebox\cache (the database and cache), and under C:\ProgramData\Squeezebox\prefs (the settings file which is called "server.prefs").

1. I made a copy of the whole cache directory (C:\ProgramData\Squeezebox\cache) to another directory called cache_2 (C:\ProgramData\Squeezebox\cache_2). Make sure to copy everything including subdirectories!
2. I made a copy of the server.prefs file (C:\ProgramData\Squeezebox\prefs\server.prefs) to another one called server_2.prefs (C:\ProgramData\Squeezebox\prefs\server2.prefs)
3. In the directory C:\ProgramData\Squeezebox I created a small batch file togglelib.bat (attached to this positng. remeber to save it as .bat and not .txt) that stops the windows service running LMS, switches the cache directory and settings file and restarts the service. I have created a shortcut to this file and placed on the server desktop.

In this simple way I can have two completely separate libraries and sets of settings. Once the above is on place by remoting to your LMS server and starting the batch file (C:\ProgramData\Squeezebox\togglelib.bat) or a shortcut to it you will switch between the two libraries. The batch file shows a command box window which is open while it is processing. When it disappeares LMS is ready again to be used.

So far of course the two libraries are identical, so not much fun with it ;-).

4. Now you can open the LMS control panel (or you can do it from the WEB interface) and define what directories need to be scanned for the specific library, as well as change the name for the library. This is useful so that you can see from your Squeezebox which library you are using. If you have changed directories you need to do a full clean up and scan of it.
5. Once you are done rebuilding the first library, switch library by running the batch file and repeat step 4 for the second library (and give it a different name). Once rebuild of the second library is done you have two separate libaries you can switch between.

Still Erlands plug-in is a much better solution, but if you don't have the horse-power to run extra plug-ins this can be a useful work-around.

Downside of this solution are:
1. Speed. Stopping and restarting the service can take some time. On my very underpowered server it can take between 15 secinds and 2 minutes!
2. Rebuilding libaries. If you add music you wnat reflected in both libraries you need to do the rescan twice, once for each libary.
3. You need to split your music files in different directories in order to be able to build different libraries. For example my wifes wnats to see only a subset of the full library so I have moved the artists she likes in a directory and the rest in another. The in the settings I point only to her directory for her library and to both for mine.

I hope this can be useful. I would have liked to use the execute script plugin to be able to switch from the squeezebox instead of having to remote to the server but so far I have not been able to activate it on my LMS.

I have attached also another batch file "statuschk.bat" which I use to check what the status is and that everything is running correctly. This file must also be located under C:\ProgramData\Squeezebox.
Attached Files

Viewing all articles
Browse latest Browse all 5300

Trending Articles