shemanaev / jellyfin-plugin-media-cleaner

Automatically delete played media files after specified amount of time.
MIT License
78 stars 1 forks source link

Ignore plays that happened before the item was added #36

Closed NicolaSmaniotto closed 8 months ago

NicolaSmaniotto commented 8 months ago

If a user has watched an item before it was added to Jellyfin, that play is ignored.

This is needed because the Trakt plugin sets the exact date of last play. In this scenario: a file is imported, it is marked as watched by Trakt, this plugin sees it as expired, and the file is immediately deleted.

My reasoning for this change is that while a file is in Jellyfin, it should stay there until someone actually watches it. This would also remove the need for the setting to mark items as unwatched on deletion, as future imports would simply ignore those plays.

Please note that I'm not at all familiar with C# or Jellyfin plugins, so double check my code. Also, this feature should probably be put behind a user setting, but I don't know how to do that. Feel free to make all the changes you deem necessary.

Closes #34.

shemanaev commented 8 months ago

Hi. Thanks for your contribution!

Also, this feature should probably be put behind a user setting, but I don't know how to do that

I think this feature makes a lot of sense by default and don't need different settings. At least for now I don't see case when you want your freshly added files being deleted instantly 😄

This would also remove the need for the setting to mark items as unwatched on deletion

You're right, this setting will probably be removed in the future versions (although still can be useful outside of plugin's scope).