I am admittedly very new to UMS but I believe I've found a bug.
I am attempting to implement two virtual folders. The UMS.conf file says that the format should be:
VFolderName1|Folder1Path,Folder2Path;VFolderName2|Folder1Path
The line in my UMS.conf is:
virtual_folders = TV\\ Shows|/mnt/media/Video/TV_Shows;Web\\ Shows|/mnt/media/Video/Web_Shows
After saving UMS.conf and restarting UMS the websever is unavailable. Checking debug.log shows the following:
DEBUG 2019-04-08 21:14:36.570 [main] Reading virtual_folders: "TV\ Shows|/mnt/media/Video/TV_Shows;Web\ Shows|/mnt/media/Video/Web_Shows" (default: "")
WARN 2019-04-08 21:14:36.620 [main] Folder not found: File "/mnt/media/Video/TV_Shows;Web\ Shows" not found
ERROR 2019-04-08 21:14:36.620 [main] A serious error occurred during Universal Media Server initialization: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 75 path $
DEBUG 2019-04-08 21:14:36.622 [main]
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 75 path $
at com.google.gson.Gson.assertFullConsumption(Gson.java:864)
at com.google.gson.Gson.fromJson(Gson.java:854)
at com.google.gson.Gson.fromJson(Gson.java:802)
at net.pms.configuration.MapFileConfiguration.parseVirtualFolders(MapFileConfiguration.java:118)
at net.pms.dlna.RootFolder.getVirtualFolders(RootFolder.java:477)
at net.pms.dlna.RootFolder.discoverChildren(RootFolder.java:195)
at net.pms.dlna.RootFolder.discoverChildren(RootFolder.java:117)
at net.pms.configuration.RendererConfiguration.getRootFolder(RendererConfiguration.java:507)
at net.pms.PMS.getRootFolder(PMS.java:159)
at net.pms.PMS.init(PMS.java:659)
at net.pms.PMS.createInstance(PMS.java:900)
at net.pms.PMS.main(PMS.java:1070)
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 75 path $
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1568)
at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1409)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
at com.google.gson.Gson.assertFullConsumption(Gson.java:860)
... 11 common frames omitted
DEBUG 2019-04-08 21:14:36.839 [pool-1-thread-4] root req /
Take special notice of this line showing that the "folder" path is including the semi-colon and name of the 2nd virtual folder.
WARN 2019-04-08 21:14:36.620 [main] Folder not found: File "/mnt/media/Video/TV_Shows;Web\ Shows" not found
It appears as though the two instances of virtual folders are not being properly delimited by the semicolon characters.
VFolderName1|Folder1Path,Folder2Path;VFolderName2|Folder1Path
It means:
Movies|d:\\media\\tv,d:\\media\video,e:\\movie;Music|f:\\audio,d:\\media\\mp3
As the slash is a special character on both Windows and Linux I don't suppose you can use it in the name of virtual folder.
Btw. be prepared that concatenated physical folders into virtual ones are not ordered per settings (alphabetically,...)
You will see them as an independent blocks. I think this "bug" was never fixed from time of first implementation.
Thank you for the reply @ExSport but I don't think that my problem is with slashes.
virtual_folders = TV\\ Shows|/mnt/media/Video/TV_Shows
and
virtual_folders = Web\\ Shows|/mnt/media/Video/Web_Shows
work fine resulting in a folder called "TV Shows" that points to /mnt/media/Video/TV_Shows or a folder called "Web Shows" that points to /mnt/media/Video/Web_Shows (respectively).
It's only when I combine both parameters with a semicolon (see below) that I get the error and the server doesn't start.
virtual_folders = TV\\ Shows|/mnt/media/Video/TV_Shows;Web\\ Shows|/mnt/media/Video/Web_Shows
I used virtual folders years ago as the is buggy ordering so can't say how it works.
But if I remember right it worked but I never used slashes for virtual names. It is worth a try. Maybe slashes works only in case you will not combine them with ";" or more probably there is a bug as you say 馃槉
There is a bug I am working on it. @begleysm you can use VirtualFolders.conf instead.
Yay, now I see. In past I used virtualfolders.conf (json if I remember right) and missed you are doing it via ums.conf. 馃槆
Sorry for misunderstanding.
Thank you (both) for the follow up. I briefly tried VirtualFolders.conf without success. I'll go back and attack that method again.
@begleysm I agree with @ExSport that using back slashes in the virtual folder name is nonsens. Fortunatelly the code ignores that. In the virtual folder name you cannot define virtual subfolders. The virtual folder name is shown in the root UMS folder and there is no way to define its subs folders whose are in fact parsed automatically.
The fix is merged now and I'm planning the 8.0.2 release either this week or next week which will include it
Awesome!
Regarding the slashes. I didn't intend on having "slashes" in the virtual folder; I wanted a space. The examples don't show cases with spaces so I guessed and wrote the name as "TV\ Shows" with the intention of getting "TV Shows".
It automagically got changed in the config file to "TV\ Shows" but ended up displaying correctly as "TV Shows" so I left it alone.
I'll try doing
virtual_folders = TV Shows|/mnt/media...
and see what happens.
It would be awesome if the examples (on the config file comments and in the wiki) showed cases with spaces in the virtual folder name and spaces in the path.
I installed 8.1.0 and can confirm that the fixes applied solved my problem! Thanks!
Also, in reference to my above comment leaving out all slashes works. My current config line is
virtual_folders = TV Shows|/mnt/media/Video/TV_Shows;Web Shows|/mnt/media/Video/Web_Shows
The above config line creates 2 links on the webpage called "TV Shows" and "Web Shows".
Thanks for confirming the fix!