Posts: 14
Joined: Nov 2016
Reputation:
0
blich
Junior Member
Posts: 14
I'm creating a context menu item addon that adds a Delete button in TV Shows. Right now, I have it deleting the file from the backend and then relying on WatchDog to update the library.
When I delete in TV (using the built-in functionality), it removes it from the library instantly.
Am I using the right approach (deleting the file), or is there a better way to do it? Maybe a database delete statement?
Posts: 14
Joined: Nov 2016
Reputation:
0
blich
Junior Member
Posts: 14
In TV, the deletion is not instant, but it's removed within a second or so.
When I delete a TV show, I get the "Are you sure..." prompt. I don't see the "Remove from library" prompt, but it still deletes the show.
I'm using the Estuary skin with no mods.
I'd like to replicate this functionality in the TV Shows area with a context menu item. I can delete the file now, but I have to wait until the library refreshes for the file to actually disappear from the UI.
Posts: 20,208
Joined: Apr 2017
Reputation:
1,339
To delete the actual video file, you need to enable that function in settings...
Settings>Media Settings>General and enable "Allow file renaming and deletion"
It is hard to follow your "deletion" talk as I am not sure if you are referring to Library or File deletion. You seem to be skipping between the two. What are you actually trying to do? Be specific.
Posts: 14
Joined: Nov 2016
Reputation:
0
blich
Junior Member
Posts: 14
Sorry for the confusion here.
I'd like to create a context menu item in TV shows called Delete. When I select this context menu item, it should delete the actual file itself, and also remove it from the library. I have the file deletion working, but I'm not sure how to remove it from the library. Is there a method I can call to remove a specific file from the library?
Posts: 14,213
Joined: Nov 2009
Reputation:
706
Klojum
Lost connection
Posts: 14,213
Referring to the Kodi library, 99/100, means referring to the database, and not the actual file(s).
Deletions are always first done in Kodi's database as a precaution, and secondly by deleting the file(s) on the HDD/SSD/USB/etcetera. A database entry without a file is useless.
The "Remove from Library" is already there, it's under the "Manage" menu item of the context menu.
Adding a 2nd delete menu-item is a bit weird to me.
Posts: 14
Joined: Nov 2016
Reputation:
0
blich
Junior Member
Posts: 14
Agreed that having both delete and remove buttons are weird. However, does Remove from library delete the actual file? If not, won't the database entry come back when the library is updated again?
Posts: 20,208
Joined: Apr 2017
Reputation:
1,339
Yes, that was answered in my previous post.
Posts: 14
Joined: Nov 2016
Reputation:
0
blich
Junior Member
Posts: 14
I might be misunderstanding the reply.
I just tested that the Remove from library button under Manage in TV shows does not delete the actual file. It only deletes the database entry so it comes back when the library is updated. However in TV, the Delete button both removes it from the database and the file itself. Is the Delete button in TV handled by the PVR client? I'm using pvr.wmc.
The Delete context menu item that I'm creating in TV Shows would delete both the database entry and the actual file. I'd like to use a built-in way if it's possible.
Posts: 14,213
Joined: Nov 2009
Reputation:
706
Klojum
Lost connection
Posts: 14,213
Do have the Kodi GUI option "Allow file renaming and deletion" in the Settings/Media/General section enabled?
If not, the 2nd part of deleting the actual file may be left out.
If so, there would be something weird going on when the confirmation for deleting the file would not happen.
Posts: 14
Joined: Nov 2016
Reputation:
0
blich
Junior Member
Posts: 14
Ah! I did not have that option enabled. Thanks!