How to exclude some folders from browsing videos?

I have a Linux server where there is a video file library organized with subfolders for various kinds of videos.
I also have several OSMC RPi boxes looking at the videos via nfs sharing of the server top level folder. This has worked fine for some time but now it is getting unwieldy.

My problem is that the number of folders have grown over the years since new types of videos have been added and now I am searching for a way to tell the Kodi boxes to not show some directories while browsing in the Kodi menu.
For example limit the number of folders on the Kodi player in the children’s room to only children’s videos.
But on my own player show all folders etc…

I would like to configure each OSMC box to tailor the directories listed when navigating the videos for viewing such that I could define which folders will be visible in the navigation list.

I have seen the way to exclude a directory from showing up by placing an empty file named .nomedia inside the directory and then it will not be listed.
But I tried it and it does not work for me at least… :frowning:

And this would affect ALL media players using the video server source and I want to configure the access individually for each media player.

Can this be done via some setting in a KODI configuration file?
If so how?

What you’re looking for are Smart Playlists.

These allow you to (de)select paths in your video folders and much more.

Playlists can easely be added to menu items.

Thanks, but I need something I can set up from the command line…
I have access via SSH to all of the OSMC boxes and I want to set them up differently regarding which folders they can navigate into from the Kodi GUI.
All are hooked up to the same video starting folder on the Linux server.

But I don’t want to visit all of these places and perform the config using a GUI style method. Takes too much time and requires for me to go to these devices a couple of which are 100 km away…

You can also set up those smart playlist via the command line.

See: Smart Playlist / XSP Method

And if you have trouble creating that XSP manually, you could do it via the GUI on your local device and then copy/paste it via SSH to your remote devices.

If you can formulate a regex that captures only the items you want to hide from browsing or scraping you can do this via an advancedsettings.xml. If you take a look at the top of a Kodi log from current OSMC releases you will see how we used this to exclude a couple things.

As for the .nomedia file that only keeps the files in the folder that it is in from being scrapped, it isn’t intended to keep files from being browsed in file mode.

Alternatively I could do as follows:

  • Create a “$HOME/mediafiles/video” dir
  • Symlink the selected folders in /mnt/sharedir/ into this video dir
  • Set the video dir as a source in userdata/sources.xml
  • Restart the media server

Now the Kodi FILES browser only displays the symlinked dirs and the files inside each such dir.

This might be the easiest solution to set up.

Why bother with the symlink’s? Wouldn’t it be easier to just configure a Kodi multipath source to these select directories if the content is already outside the source paths for your library items? By multipath source I mean that Kodi allows a single file source to point to multiple different paths and it just concates them when your browse in file mode such that they appear as if every item in every base source path was combined into one.

1 Like

Because I have a server based file library which is used by multiple OSMC boxes via nfs file sharing.
The nfs connection winds up in /mnt/nfs/… and is symlinked into the $HOME dir where Kodi looks.
No need for any “scraping” either because these files are just video files and need only the descriptive file name…

Now, the server has a lot of stuff and I don’t want everything to be accessible on all OSMC devices, so that is why I asked.

For instance my private videos are there but I don’t want everyone to see them, likewise for the children’s OSMC I want only cartoons and stuff to be available.
Currently there are 5 such “clients” and another on the way in.
Some clients connect into my server location via VPN over Internet too.
For these I set up OpenVPN on the OSMC device as well.

I am configuring each OSMC device (Raspberry Pi units) for the specific use case and I have now decided on the symlink path.

I also use autofs so that in case of networking issues a mount is not lost and you have to reboot the device. Instead it is just reconnecting on demand. Very neat!