Would love to have the option to delete watched videos just like recordings

It would be very helpful to have the option to automatically mark watched videos for deletion after a given period of time just like we can already do with recordings…

I love Channels and am so thankful for all of your hard work!

Do you mean imported media, like imported Videos, Movies and TV Show episodes?

Yes. I host my downloaded YouTube videos on Channels and it would be nice if watched videos could be marked for deletion instead of having to remember to manually delete them…

This is a very interesting scenario, quite unique, I would say. :wink:

I would be very surprised if this ever became a feature in Channels.

In the meantime, I'm pretty sure a script could take care of this. That's my opinion.

I was considering some sort of a script as you suggest but came up blank as I can’t think of a way to mark watched videos in such a way that I could incorporate it into a script…

If you create video groups properly, you can use the Channels API to retrieve the list and attributes of all videos in a specific group.

I think this would be a good starting point.

Even better, you can directly get the list of watched videos in the group!

Basically, add ?watched=true at the end of the URL.

Once you have a list of file IDs that you want to delete, you can send a command to the server (at your own risk!) to put those files in the trash.

image

This is something we have wanted to do for a while, but have yet to do it for technical reasons.

Basically, the pruning rules on passes should be available on TV Shows and video groups. Then, even imports and videos would get the pruning features.

So it’s in our heads, we just have to solve some other things first.

As for a script, you could easily just take a set of video groups, get their IDs, then read through all the files that have that group ID and delete the ones that are marked as watched.

I won’t go into the details on how to do every step of this, but this is the strategy that would work. Everything is there to make a script like this.

I have an idea of how to create this script, however is it possible to create a webhook for the trash command for the channels server? In my case it would be the trash command for each video group which I have created and wish to run the script?

Just saw this feature request and I also cast my vote for this feature. Plex, Emby and JF has this feature so I wish Channels do too especially for those who use PlayOn Cloud or have dozens of Youtube videos on hand that were watched. Going in there to delete what is watched is a tedious task...

I created a macOS shortcut which runs every few minutes and uses a webhook to delete all watched videos. It works very reliably. I’m not sure what platform you’re using, but you might consider doing something similar until this feature is officially supported…

I'm using windows. Not too sure how to do that. Maybe something could be done inside Olivetin (@bnhf)?

Unfortunately I wouldn’t be able to guide you using Windows. However, I can share the basics and you could fill in the gaps if you’re willing to do the research. Basically you would use the API & feed explorer from the server admin and create a filter to expose all of your watched videos. You would then need to use that link to pull down the JSON and extract all of the video id’s of the videos to be deleted. Finaly you would use a webhook to delete each video using the id’s from the JSON. It took some time to set it up, however it now runs in the background and I don’t even think about it…

Would you be willing to post some specifics on what you're doing? Having the API call(s) you're using, and other details of the process, would help me setup something similar in OliveTin-for-Channels.

2 Likes

I’m happy to help. Here’s a screenshot of the shortcut I created using macOS. You should be able to adapt it to your needs.

Good luck! :grinning:

1 Like

Deleting watched videos, either on a one-time basis, or every x minutes/hours has been added to OliveTin-for-Channels 2024.07.03. There's also a healthchecks.io option to let you know if it fails to run as scheduled for any reason. Pull bnhf/olivetin:latest to take advantage of this new action.

screenshot-htpc6-2024.07.03-15_52_05

1 Like

This looks great, unfortunately I don’t have any experience with Portainer. Im just using barebones Docker on my Mac Mini M2.

I didn’t either, until I installed Portainer for OliveTin on my Mac Mini too. Easier than Docker IMO — and it automatically worked with all the containers I already had running. Totally worth it!

2 Likes

And you could keep an eye on your containers remotely and turn them on or off. Very good stuff.