Panopto API 204: Retention policies and deleting old videos

Return to the Panopto API index page

Something we’ve struggled with over the years is how to handle our retention policy. There are a lot of videos in a lot of places and once you delete a video it is exceptionally hard to get it back.

The following code follows on from the looping code on 203. It doesn’t delete any files, but instead renames them. The idea is as follows

  1. Find all videos made that are due to be deleted due to the retention policy
  2. Rename all the videos so that video owners can check which files will be deleted (and allow them to remove the deletion warning
  3. Search using the main Panopto website for the deletion warning on the day in the warning, select all and delete

Here is the code

These are the a) The last date that is suitable to be found and b) the date you are planning on deleting the video files.

These dates are used in

Pro Tip: If your have a rolling retention policy (18 months, not “every summer”) then useĀ StartDate to ensure you don’t constantly mark an old video for deletion that should be kept.

Then we add this code to our results

The code is very simple. It checks to see if the warning is already placed on the video, and if it isn’t it will add the text [DELETION WARNING: Session will be deleted on xx/xx/xxxx] to the end of the title

Running the code will rename the video files

All sessions, you can see that some are marked for deletion

Then when the date comes, just search for the deletion warning, select all and delete. If an academic wants to keep the video, they simply need to rename the session to remove the warning.

Now I can see what I’m deleting, but only deleting old files

Full code below

 

Return to the Panopto API index page

Leave a Reply

Your email address will not be published. Required fields are marked *