jellyfin-plugin-media-cleaner: [Bug]: wrong interaction between filters
What happened?
I configured the new " Keep not played for X days" option to 60 days, but I noticed that it would try to delete some movies even when in my opinion it should not.
Here is a specific example:
Nosferatu was added to the server on the 31st of January 2023.
I’ve watched it recently, the log shows:
[Deb] ItemsAdapter: "Nosferatu" played by "nicola" (01/31/2024 00:20:11)
Since it has been opened in the last 30 days, then the log shows:
[Tra] Filtering.ExpiredFilter: Filtering item "Nosferatu"
[Tra] Filtering.ExpiredFilter: Latest played by "nicola"
[Tra] JunkCollectors.MoviesJunkCollector: "Nosferatu" filtered by Expired
Then when the new filter is applied:
[Tra] Filtering.ExpiredNotPlayedFilter: Filtering item "Nosferatu"
[Tra] Filtering.ExpiredNotPlayedFilter: Not played by anyone since 01/31/2023 00:00:00
And at the bottom:
[Inf] MediaCleanupTask: (Movie) "Nosferatu" will be deleted because no one played it since 01/31/2023 00:00:00
I think this is not intuitive at all (or even wrong). I don’t want the plugin to delete something that users are watching, no matter how old the file is.
A solution could be to run the ExpiredNotPlayedFileter first, to collect all the old files, then the ExpiredFilter, overwriting the list if needed. Finally check its most recent play.
Troubleshooting info
* Jellyfin version: 10.8.13
* Plugin version: 2.14.0.0
<details>
<summary>Configuration</summary>
<pre>
<PluginConfiguration>
<KeepMoviesFor>30</KeepMoviesFor>
<KeepMoviesNotPlayedFor>60</KeepMoviesNotPlayedFor>
<KeepPlayedMovies>AnyUserRolling</KeepPlayedMovies>
<KeepFavoriteMovies>AnyUser</KeepFavoriteMovies>
<KeepEpisodesFor>30</KeepEpisodesFor>
<KeepEpisodesNotPlayedFor>-1</KeepEpisodesNotPlayedFor>
<KeepPlayedEpisodes>AnyUserRolling</KeepPlayedEpisodes>
<KeepFavoriteEpisodes>AnyUser</KeepFavoriteEpisodes>
<DeleteEpisodes>Season</DeleteEpisodes>
<KeepVideosFor>-1</KeepVideosFor>
<KeepVideosNotPlayedFor>-1</KeepVideosNotPlayedFor>
<KeepPlayedVideos>AnyUserRolling</KeepPlayedVideos>
<KeepFavoriteVideos>AnyUser</KeepFavoriteVideos>
<KeepAudioFor>-1</KeepAudioFor>
<KeepAudioNotPlayedFor>-1</KeepAudioNotPlayedFor>
<KeepPlayedAudio>AnyUserRolling</KeepPlayedAudio>
<KeepFavoriteAudio>AnyUser</KeepFavoriteAudio>
<KeepAudioBooksFor>-1</KeepAudioBooksFor>
<KeepAudioBooksNotPlayedFor>-1</KeepAudioBooksNotPlayedFor>
<KeepPlayedAudioBooks>AnyUserRolling</KeepPlayedAudioBooks>
<KeepFavoriteAudioBooks>AnyUser</KeepFavoriteAudioBooks>
<UsersIgnorePlayed>
<string>da1c429756594ff6b4719d24d1f65c9c</string>
</UsersIgnorePlayed>
<UsersPlayedMode>Ignore</UsersPlayedMode>
<UsersIgnoreFavorited>
<string>da1c429756594ff6b4719d24d1f65c9c</string>
</UsersIgnoreFavorited>
<UsersFavoritedMode>Ignore</UsersFavoritedMode>
<LocationsExcluded>
<string>/run/media/hpuser/hdd1/media/movies</string>
<string>/run/media/hpuser/hdd1/media/trakt-watchlists</string>
<string>/run/media/hpuser/hdd1/media/series</string>
</LocationsExcluded>
<LocationsMode>Include</LocationsMode>
<MarkAsUnplayed>false</MarkAsUnplayed>
</PluginConfiguration>
</pre>
</details>
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (13 by maintainers)
Commits related to this issue
- Bump version Fixes #39 — committed to NicolaSmaniotto/jellyfin-plugin-media-cleaner by shemanaev 3 years ago
- Bump version Fixes #39 — committed to NicolaSmaniotto/jellyfin-plugin-media-cleaner by shemanaev 3 years ago
Thanks for comprehensive testing! I’ll push an update to release.