Best way to delete from TV shows
#1
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?
Reply
#2
Quote:When I delete in TV (using the built-in functionality), it removes it from the library instantly.
That sounds a bit weird, because there is no instant removal.

There are two deletions:
1 - Delete the database entry/ies
2 - Delete the actual video file(s)

Pressing the DEL button on a tvshow via the video library will always get you a confirmation dialog ("Are you sure..."). The deletion of the actual tv show episode files after that is done via a second confirmation dialog.
"Remove from library" of a tvshow via the context menu follows the same route.

This is all via the default Estuary skin. Are you perhaps using a different skin (with possibly different fuctionality)?

Deleting via the database is certainly not the preferred option, unless you have total knowledge of the Kodi database structure and know which other tables are affected when a tv show/episode is deleted. Without that knowledge, you can end up with a corrupted video database.
Reply
#3
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.
Reply
#4
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.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#5
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?
Reply
#6
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.
Reply
#7
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?
Reply
#8
Yes, that was answered in my previous post.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#9
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.
Reply
#10
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.
Reply
#11
Ah! I did not have that option enabled. Thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
Best way to delete from TV shows0