How to limit the number of folders in the video view?

EDIT:
This post is about the selection of video folders to show in the Video menu and the UPnP listing on a smartTV. Don’t want all shown.

I have OSMC latest version on an RPi4B (just checked the state through MyOSMC) which is used to view downloaded news shows.
The downloads are done on an Ubuntu server into a folder for each type of shows. This server side main folder is mounted via nfs to my OSMC device and therefore all files and subfolders are also visible… :frowning:

And in the parent folder for the news videos there are also other folders containing video files which I do not want to publish through OSMC (the selection display gets cluttered too much then).
So is there any way to define the actual video folders to be listed as sources below the main mounted drive folder via UPnP?

Can I for instance symlink the wanted video folders from the mount point to a different internal folder and then set that as the video source in sources.xml?
Or will symlinks not work in that case?

Alternatively, is there a way to specify folders NOT to show up in the video menu (like a keep-out list)?

Another similar item:
On the UPnP display used on some of our TV:s I do not want anything but Video Library to show up and now there are also Music Library, how do I block that from showing up? I do not have any such material so it just adds another unnecessary level of selections when using it.

TIA

I found that the possibly only way to do this is to edit the $HOME/.kodi/userdata/sources.xml file and add each real video directory as a source. With that done one gets only those sources that one wants on the display.

But it raises another question:
Is it possible somehow to have a two-level menu where there can be a couple of main entries and below those a list of files inside that specific folder?
What would be the format in the sources.xml file for this to work?

I have several different video sources and each have their own hierarchy of folders and files where some of the folders do not contain any videos but get listed anyway…
The sources.xml file is structured like this concerning videos:

    <video>
        <default pathversion="1"></default>
        <source>
            <name>1. Ubuntusrv NFS</name>
            <path pathversion="1">/mnt/ubuntusrv/msnbc</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>2. Synology NAS NFS</name>
            <path pathversion="1">/mnt/nas/VIDEO</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>3. Localdrive</name>
            <path pathversion="1">/media/media/localdisk/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>4. Local media 2</name>
            <path pathversion="1">/home/osmc/mediafiles/video/</path>
            <allowsharing>true</allowsharing>
        </source>
    </video>

Can a source as defined above have sub-items defined as well?
If so how is the correct syntax for that?

So, for me it is difficult to understand what you are trying to achieve and what the real problem is. Perhaps, the following two idea helps you a bit:

  1. If you start with fresh MyVideos131.db (so, you stop the mediacenter, delete the db and restart the mediacenter), you can set the content of such source like

When being asked DO NOT refresh all information for all items within path.

Now, you can select each sub-folder you want to include in the library and remove the “exclude” flag like

Afterwards do an Update Library in the Videos menu and you’re done.

  1. You can use multi-path items in the sources.xml. Imagine you have paths
/mnt/ubuntusrv/msnbc/A
/mnt/ubuntusrv/msnbc/B
/mnt/ubuntusrv/msnbc/C
/mnt/ubuntusrv/msnbc/D
/mnt/ubuntusrv/msnbc/E

and you only want to include the folders A, B and C then you can specify in sources.xml

        <source>
            <name>1. Ubuntusrv NFS</name>
            <path pathversion="1">/mnt/ubuntusrv/msnbc/A</path>
            <path pathversion="1">/mnt/ubuntusrv/msnbc/B</path>
            <path pathversion="1">/mnt/ubuntusrv/msnbc/C</path>
            <allowsharing>true</allowsharing>
        </source>

Hope this helps a little bit.

Well, I have multiple source servers with mp4 video files on my network.

So I want to publish/view these in my OSMC device and therefore I have mounted the video dirs on these devices to my OSMC device.

Then I can add each of these mounts into my sources.xml file and give them a friendly name and they will appear below the Files entry in the Kodi menu with the names I set.
So far all is well.

But in each of these mounts there are subfolders holding the videos AND folders not having anything I want to publish to my OSMC box. There are script folders and other ordinary file folders etc.
These folders will appear in the Kodi list but when one enters them they are all empty, so they just clutter the display with unneeded selection items…

That is why I wanted to be able to specify what should appear in Kodi one level below the items I had added above. And I assumed there would be a syntax trick for the sources.xml file to achieve this.

I tried your suggestion as follows:

        <source>
            <name>2. Ubuntusrv All MSNBC NFS</name>
            <path pathversion="1">/mnt/ubuntusrv/msnbc/A</path>
            <path pathversion="1">/mnt/ubuntusrv/msnbc/B</path>
            <path pathversion="1">/mnt/ubuntusrv/msnbc/C</path>
            <path pathversion="1">/mnt/ubuntusrv/msnbc/D</path>
            <allowsharing>true</allowsharing>
        </source>

Where A, B, C, D are the individual show names which I want to see as folder names.
But this just packed all of the files in all these folders into a single display folder view sorted by the individual mp4 file names so there is no longer any way to separate the shows to view each installment sequentially.

What I wanted was to see a second level list of folders I can select from to reach these shows.

Well, the idea with kodi is to have all your video/music material scraped into the library and use the Movies and Music menu capabilities to organize the items and views. The origin path is not important by that concept.
You want to have something like a customized file view. I am at a loss as to whether such a thing exists.

1 Like

I ended up creating a special folder /home/osmc/mediafiles/msnbc into which I symlinked the folders from the mount that actually contain the wanted mp4 files using the specific source folder names .
Then I edited the .kodi/userdata/sources.xml to contain one entry like this for each subfolder in the directory:

        <source>
            <name>01-Latest msnbc</name>
            <path pathversion="1">/home/osmc/mediafiles/msnbc/latest/</path>
            <allowsharing>true</allowsharing>
        </source>

With this in place for the 17 folders the leading numbers in the “name” item made the DLNA display on the TV ordered the way I wanted it.

And this is now used both when the Kodi GUI on the RPi (with a screen attached) and on the Video applet on the TV when I use DLNA viewing on that.
So I have done a workaround but it does work now.