Skip to content

Virtual Library Creator - a plugin for Lyrion Music Server. A quick and easy way to create and manage your own virtual libraries/library views.

License

Notifications You must be signed in to change notification settings

AF-1/lms-virtuallibrarycreator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Virtual Library Creator

Create custom virtual libraries / library views with optional LMS browse menus using a template in a browser or by adding files with customized SQLite statements.

The template allows you to create virtual libraries for many purposes, but of course it can not cover all conceivable use cases.
💡 Don't forget: with this plugin you can also use customized (raw) SQLite statements tailored exactly to your needs (see FAQ).



⬅️ Back to the list of all plugins

Use the    icon (top right) to jump directly to a specific section.



Screenshots1




Features

  • Create custom virtual libraries using a template in a browser or by adding your own sql files with customized SQLite statements.

  • Create optional LMS browse menus for your virtual libraries.

  • Have some or all of your virtual libraries automatically refreshed daily at a specific time.

  • Enable/disable individual virtual libraries.

  • Temporarily pause/disable all virtual libraries (e.g. for troubleshooting).




Requirements

  • LMS version >= 8.4
  • LMS database = SQLite


Installation

Virtual Library Creator is available from the LMS plugin library: LMS > Settings > Manage Plugins.

If you want to test a new patch that hasn't made it into a release version yet, you'll have to install the plugin manually.



Reporting a new issue

If you want to report a new issue, please read the FAQ first and then fill out this issue report template.

If you use this plugin and like it, perhaps you could give it a ⭐ so that other users can discover it (in their News Feed). Thank you.



FAQ

»How do I create custom virtual libraries?«

  • using the VLC template:

    • Go to LMS Home menu > Extras > Virtual Library Creator > Create new virtual library.

    • Enter a name (required), set the parameters you want to use and then save it. That's it.

    After a couple of seconds, LMS will start creating your virtual library (and any browse menus you've enabled). Depending on the size of your virtual library, this may take a while.

    💡 You don't have to use browse menus. You can just create virtual libraries / library views without browse menus.


  • adding manually customized SQLite statements:

    Users familiar with SQLite can add an sql file to the VirtualLibraryCreator folder with a customized SQLite statement.
    You can add browse menus and some options to a virtual library based on a customized SQLite statement in VLC but you cannot edit your SQLite statement in the VLC plugin itself.

💡 Virtual libraries and their optional browse menus are only created if you've enabled them, i.e. checked the Enabled box.


»How do I edit custom virtual libraries I've created with this plugin?«

Virtual Library Creator displays a list of all virtual libraries that you have created with this plugin.
If you want to change the name of your virtual library or some parameters, click on the `Edit` button next to the virtual library's name, make your changes and save it. After a couple of seconds, LMS will start recreating your virtual library and pick up the changes.


»What do the icons in the virtual library list mean?«

: This virtual library has browse menus.

: This virtual library is scheduled for a daily refresh.

: This virtual library is enabled.

: This virtual library is disabled.

: This virtual library like all other VLC virtual libraries has been temporarily paused/disabled.

Temporarily (un)pausing all VLC virtual libraries does not change the enabled/disable parameter of individual virtual libraries.


»Can I edit the SQLite statement of my virtual library manually in VLC?«

The target group for this plugin is users who want to quickly and easily create custom virtual libraries using only a web browser template and do not want to work with raw SQLite statements. Accordingly, VLC does not include the option to edit SQLite statements manually in a tiny text area.


»LMS is unresponsive for a short time after I've saved a new/edited virtual library or after a reboot/rescan. Why?«

The time LMS takes to boot or to recreate virtual libraries increases with the number of virtual libraries enabled and the library size. So if you have a rather large library and many virtual libraries with a lot of tracks, it'll take LMS some time to recreate them.
During that time LMS may be rather sluggish or unresponsive. That's normal. You can set the debug level for this plugin on the LMS settings > Logging page to Info to get more precise time information.

When you've saved a new or edited virtual library, the plugin will wait about 3 seconds before telling LMS to (re)create new and edited virtual libraries. Same as above: LMS may be rather sluggish or unresponsive during that time and you won't see any browse menus before this process is completed.


»What's a daily refresh?«

Normally, LMS recreates virtual libraries only after a rescan or reboot which updates the list of tracks matching the search parameters of your virtual libraries.

However, if you rate, play or skip tracks between rescans/reboots, virtual libraries with parameters like rating, playCount, date lastPlayed, skipCount, date lastSkipped or dynamic played skipped value may not contain all matching tracks.
In these cases, you can use the daily refresh option. Once a day at a time that you can set in the settings, VLC will refresh/rebuild all VLC virtual libraries with this option enabled, i.e. update the list of matching tracks. If your server is in sleep mode or switched off at this time, the refresh will happen as soon as the server wakes up or is switched on again.


»What effect does the Home menu position parameter have?«

To reduce clutter all browse menus are collected (as sub-menus) in the VLC menu folder by default. You can change name and icon of this folder in the plugin settings.

If you want your menu(s) to be displayed in the LMS Home menu (top level menu), check the Display in Home menu box. They will be appended to the end of the LMS Home menu unless you set a value for Home menu position.

The Home menu position field expects a number that determines the position in the home menu. The higher the number, the further down the LMS Home menu your browse menus are placed.
Collected browse menus (in the VLC folder) are sorted alphabetically by virtual library id. Home menu position values have no effect there.


»I've changed the name of a virtual library but its browse menus in the VLC browse folder are not sorted in the correct alphabetical order. Why?«

Collected browse menus (in the VLC folder) are sorted alphabetically by virtual library id, not virtual library name. VLC uses the virtual library id for multipe purposes. It contains the library name you first(!) gave your library and does not change, even if you rename your library later on.
So if you absolutely need to change the sort order of your library's browse menus in the VLC browse menu folder, you'd have to delete the VLC library and recreate it with the correct name.


»What are the files in the VirtualLibraryCreator folder for? Can I edit them?«

When you save a new or edited custom virtual library, VLC will create 2 files in the VirtualLibraryCreator folder (default location in the LMS preferences folder, can be changed in the plugin settings):

  • the file with the customvalues.xml extension contains the parameter values you selected for this virtual library. It allows you to easily edit your custom virtual library in VLC at a later time.

  • In addition, VLC will always save your custom virtual library as an SQLite statement (file extension: sql) which is used to make LMS create your virtual libraries.

🚫⚠️ Please do not rename, move or edit any of these files yourself. VLC will overwrite the changes. Or worse, your custom virtual library or selected library view will no longer work. And please do not rename the VirtualLibraryCreator folder.


Exception: editing the customized SQLite statement of sql files that you have added manually and that have no corresponding customvalues.xml file.


»Sometimes browse menus contain incorrect and empty items.«

Under certain circumstances you may see (empty) albums, artists, genres or years in some VLC browse menus that shouldn't be there. Your virtual library does not contain incorrect tracks. This issue is linked to the way LMS creates these browse menus. There's nothing I can do about it at the moment. If possible, just go down one level: click to show all tracks or show all albums.
In case this LMS issue ever gets resolved, I'll update this page.


»What's the difference between recreating and refreshing virtual libraries?«

Refreshing (or rebuilding) a virtual library means that LMS will update the list of tracks matching the virtual library's search parameters (see daily refresh FAQ).

Recreating a virtual library means unregistering the virtual library and then recreating it. This happens, for example, when you save an edited virtual library. If you've edited only a single parameter, you'll have to pass the new search parameters to LMS so it can get the correct matching tracks. Refreshing instead of recreating would ask LMS to use the old search parameters.
So recreating and refreshing a virtual library will both update the list of matching virtual library tracks but recreating is required if the search parameters have changed.

If your virtual library is disabled or virtual libraries are globally paused/disabled, editing virtual libraries will not trigger anything. The changes will take effect the next time you enable a currently disabled virtual library or when you unpause all temporarily disabled virtual libraries.
VLC handles all of this automatically. Even though it should never be necessary, you can always force LMS to recreate all VLC virtual libraries by pausing & unpausing them or with the Manual Refresh button.


»How do I use custom tags from the Custom Tag Importer plugin?«

You can use up to 8 custom tags from the Custom Tag Importer database table. If you use different logical operators (and/or) to link them, please make sure that you group the custom tags linked by AND and those linked by OR.

Example: if you have 5 custom tags (A, B, C, D, E) and you definitely want 2 of them (A, B) and one of the remaining 3 (C, D, E), put them in this order: A and B and ( C or D or E ). The 2 ANDs first, then the ORs. Both groups are linked by AND.


»I've enabled the Albums without compilations menu for the LMS Home menu. Where is it?«

I couldn't get the Albums without compilations to work reliably in the LMS Home menu. Therefore, it's disabled. It works in the collected menus folder though.


»I can't save new virtual libraries. I get this error message: “Could not create the VirtualLibraryCreator folder“.«

The VirtualLibraryCreator folder is where VLC stores all files related to your custom virtual libraries. The folder name is hard-coded and must not be changed.
On every LMS (re)start, VLC checks if there's a folder called VirtualLibraryCreator in the parent folder. The default parent folder is the LMS preferences folder but you can change that in VLC's preferences. If it doesn't find the folder VirtualLibraryCreator inside the specified parent folder, it will try to create it.

The most likely cause for the error message above and matching error messages in the server log is that VLC can't create the folder because LMS doesn't have read/write permissions for the parent folder (or the VirtualLibraryCreator folder).

So please make sure that LMS has read/write permissions (755) for the parent folder - and the VirtualLibraryCreator folder (if it exists but cannot be accessed).


»Clicking the Manual Refresh button resets the active library view to the complete library.«

The Manual Refresh button forces the plugin to manually recreate all enabled virtual libraries (incl. menus). If you have selected a VLC library as the active library view for a client, LMS will reset the client library view to the complete library because recreating your VLC virtual library makes it temporarily unavailable.


»Can you translate VLC into my language?«

This plugin will never be fully localized because the parameter and value names in the template are hard-coded. If you want to localize the rest (e.g. for browse menu suffixes etc.), please read this. Although, IMO a halfway localized version is worse than a non-localized one.





Footnotes

  1. The screenshots might not correspond to the UI of the latest release in every detail.

About

Virtual Library Creator - a plugin for Lyrion Music Server. A quick and easy way to create and manage your own virtual libraries/library views.

Topics

Resources

License

Stars

Watchers

Forks