How to remove shares using CLI?

Hi All

As my remote doesnt work, I cant remove the shares from the GUI. Is there a way via the CLI?

Thanks

The sources are initially defined in /home/osmc/.kodi/userdata/sources.xml

But removing the source will not affect the database if you’ve created one. A little more information from you about exactly what you are trying to do would help us give a better answer.

Also, if your remote isn’t working, how are you able to even use your system?

Im using a Yamaha remote but it doesnt have a function that the OSMC remote has to access the menu to delete what i need.

Im trying to delete old shares no longer needed under MOVIES…FILES

You can delete the entry in sources.xml, but that will not remove what has already been added to the database. Once a source has been added to the database I know of no way to remove it except from the GUI. Why don’t you use the keymap editor and add a ‘context’ button to your Yamaha remote?

Once you edit the sources.xml, texturecache.py can be used to cleanup.

https://kodi.wiki/view/Texture_Cache_Maintenance_utility

1 Like

Thanks ive edited the sources and ran the script. Will check it tonight

You also can use the Webinterface as a remote.

2 Likes

Under the keymap editior which is the button that corrosponds to the Dashs on the Vero remote

.-
.-
.-

:smiley:

@dastrix If you own an Android smartphone what about using a remote app like “Kore” or “Yatse”?
Just an idea … :wink:

2 Likes

That should be normally c for context menu

If a source is removed, then a “Clean Library” should delete the information about the files that were from that source.

2 Likes

That’s correct, but it will not remove the actual source, even if it’s removed from sources.xls.

Sources aren’t stored in the database…they only place they exist is in sources.xml.

Once you scan a source, the directory paths are stored in the database, but nothing ever deletes them. Removing a source just changes some fields in the paths table to remove the information about the scraper. This is because it’s entirely possible to have paths that “belong” to multiple sources.

“Cleaning” should verify that an item in the database still exists on disk and also that the item is in a path with a root parent that has an entry in sources.xml.

In my testing, once a path is in the database with the source defined, it’s there forever. And since the OP asked about removing from command line, the only answer would be to manually edit the database. Removing the files and doing a clean would remove the path entry behind, so the source would still exist.

Do this experiment, add a new source to sources.xml and see if it shows up in the GUI with the proper content. It won’t scan until you define the content in the GUI, even if the content was defined in sources.xml.

Then remove the entry from sources.xml and the entry in the path table in the database will remain.

It’s always been strange to me that there is no way to add a source except from the GUI (or manually editing the database)

EDIT: I just did a test. I found a path in my database that does not exist in sources.xml. It was where I originally had my 4K content stored until I moved it to a new drive. So I re-created the path on the drive and added content. Sure enough it scanned the movie into the database. So you can have a source defined in the database that does not exist in sources.xml (And yes, I had run a vclean)