Jump to content


Photo

Emby Media Clean - Delete Watched Video


  • Please log in to reply
9 replies to this topic

#1 jpc82 OFFLINE  

jpc82

    Member

  • Members
  • 13 posts
  • Local time: 12:40 PM

Posted 18 September 2019 - 06:52 PM

Hi, I created a python script that will look for all watched content for a specific user. If the last played date is past the cut off date it will delete the file.

I built this for myself and it works good enough for me, but I have only tested it on my system (ubuntu 18.04) with my server. So no guarantee it will work for everyone, and since it can delete files have a backup to be safe. By default it does not delete files until you modify the config file to be safer.

It first lists all the files, then will list the files that will be deleted.

On first run it will ask you some questions to generate the config file, or you can create it manually

Here is the script if anyone else is interested in trying it out: https://github.com/c...j/media_cleaner


  • Kurosh likes this

#2 jpc82 OFFLINE  

jpc82

    Member

  • Members
  • 13 posts
  • Local time: 12:40 PM

Posted 18 September 2019 - 07:51 PM

Kurosh asked for the ability to treat TV vs Movies different.

 

For my use case I don't care and delete all files the same.  But I will try to add the ability to configure if you want Episodes, Movies or Videos to be deleted or ignored.


  • Kurosh likes this

#3 jpc82 OFFLINE  

jpc82

    Member

  • Members
  • 13 posts
  • Local time: 12:40 PM

Posted 18 September 2019 - 08:31 PM

I have pushed the new version.  Config file will need to be re-generated.  You can now have the following three options

 

video_action='delete'
movie_action='delete'
episode_action='delete'

 

Anything other then delete will ignore that content type.


  • Kurosh likes this

#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 137606 posts
  • Local time: 12:40 PM

Posted 18 September 2019 - 09:33 PM

Cool, thanks for sharing.

#5 mastrmind11 OFFLINE  

mastrmind11

    Advanced Member

  • Members
  • 2769 posts
  • Local time: 12:40 PM
  • LocationLong Island, NY

Posted 19 September 2019 - 06:28 AM

@Luke, what is the timeframe to get something like this bundled w/ Emby?  I know it's been a FR for quite some time (2 years now?).  The ability to remove watched episodes at the series level is the most basic DVR feature out there.



#6 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 137606 posts
  • Local time: 12:40 PM

Posted 19 September 2019 - 12:24 PM

This exact script isn't getting bundled. We would just do our feature for it.



#7 Kurosh OFFLINE  

Kurosh

    Advanced Member

  • Members
  • 47 posts
  • Local time: 05:40 PM

Posted 24 September 2019 - 06:35 AM

I have pushed the new version.  Config file will need to be re-generated.  You can now have the following three options

 

video_action='delete'
movie_action='delete'
episode_action='delete'

 

Anything other then delete will ignore that content type.

Thanks for this, so "movie_action" = movies and "episode_action" = TV shows. Therefore what is "video_action"?



#8 Kurosh OFFLINE  

Kurosh

    Advanced Member

  • Members
  • 47 posts
  • Local time: 05:40 PM

Posted 24 September 2019 - 06:36 AM

This exact script isn't getting bundled. We would just do our feature for it.

Any idea on a timeframe for this feature though? The feature was initially requested in June 2014 :)


Edited by Kurosh, 24 September 2019 - 06:56 AM.


#9 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 137606 posts
  • Local time: 12:40 PM

Posted 24 September 2019 - 12:01 PM

Not yet, sorry.



#10 jpc82 OFFLINE  

jpc82

    Member

  • Members
  • 13 posts
  • Local time: 12:40 PM

Posted 24 September 2019 - 08:22 PM

Thanks for this, so "movie_action" = movies and "episode_action" = TV shows. Therefore what is "video_action"?

 

video is for things in the home video or other video category.  I use that for random videos I download off the internet like youtube videos where I don't have metadata for.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users