Req How to remove a movie or episode from the library
#1
Hi,

how do I remove a specific movie or episode from the library? I wrote a context menu addon that deletes the files (they are split up) and the folder where the episode/movie is located at. This works great, but the episode/movie stays in the library so I have to run a clean. Is there a way to remove them programmatically from the library? If not how to start the clean of the library and remove all the entries where the files have been removed?
Reply
#2
(2024-03-05, 22:00)talentfrei Wrote: Is there a way to remove them programmatically from the library?

no there is not
 
(2024-03-05, 22:00)talentfrei Wrote: If not how to start the clean of the library and remove all the entries where the files have been removed?

https://kodi.wiki/view/JSON-RPC_API/v13#...rary.Clean
Reply
#3
Sounds good, but wouldn't VideoLibrary.RemoveMovie and VideoLibrary.RemoveEpisode also remove the title from the library without cleaning the whole library?
Reply
#4
(2024-03-05, 22:35)talentfrei Wrote: Sounds good, but wouldn't VideoLibrary.RemoveMovie and VideoLibrary.RemoveEpisode also remove the title from the library without cleaning the whole library?

sure but look at the parameters, it's not going to work off of a filename or episode name or movie name so you will have to perform a lookup first to get the "Library ID"

not the easiest thing to get i believe there is no filter (or i don't know how to use a filter) so you will have to use "VideoLibrary.GetEpisodes" and then filter the results in your own code, assuming the "file" field returns the correct filename https://kodi.wiki/view/JSON-RPC_API/v13#...ds.Episode

however you want to go about it, the clean is the easier method
Reply
#5
Alright, I'll try it out when I'm at home.

I'm curious how should the library id look like? When running the sys.listitem.getPath() command I get somthing like videodb://movies/titles/6 is 6 the library id or is this something completely different?
Reply
#6
(2024-03-05, 23:26)talentfrei Wrote: videodb://movies/titles/6 is 6 the library id or is this something completely different?

you will have to experiment, i'm not sure on that but seems possible that is the right id
Reply
#7
(2024-03-05, 22:00)talentfrei Wrote: how do I remove a specific movie or episode from the library? I wrote a context menu addon that deletes the files (they are split up) and the folder where the episode/movie is located at. This works great, but the episode/movie stays in the library so I have to run a clean. Is there a way to remove them programmatically from the library? If not how to start the clean of the library and remove all the entries where the files have been removed?

You are welcome to try this addon I wrote.  It may do what you want, depending upon what all has been removed.  it certainly will find orphaned data in your video library. What it won't do yet is compare what is on your drive with the file table.  I had been planning to allow selective deleting entries along with their underlying media file but with all the various extras and similar stuff, it is too much to tackle at the moment.  Right now you can view your media tree / media types in your library and run the analyzer to clean orphaned data.  Many Kodi users are using this addon to help clean their libraries.

The Wiki page is here.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#8
Thx
Reply
#9
It looks like I'm unable to post the zip file here so I'll post the link to the kodi forum where I uploaded it: https://www.kodinerds.net/thread/78422-r...men%C3%BC/

Maybe someone stumbles upon the same problem  Smile
Reply

Logout Mark Read Team Forum Stats Members Help
How to remove a movie or episode from the library0