shemanaev / jellyfin-plugin-media-cleaner

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

[Bug]: Media Cleaner stopped working 5-8 weeks ago #15

Closed MagnusL3D-code closed 1 year ago

MagnusL3D-code commented 1 year ago

What happened?

Up until 5-8 weeks ago Media Cleaner worked perfectly. Since then it has not been deleting media however.

I am getting this in the log:

[2023-02-23 09:14:04.891 +00:00] [INF] [90] Emby.Server.Implementations.ScheduledTasks.TaskManager: "IntervalTrigger" fired for task: "Played media cleanup"
[2023-02-23 09:14:04.924 +00:00] [INF] [90] Emby.Server.Implementations.ScheduledTasks.TaskManager: Queuing task "MediaCleanupTask"
[2023-02-23 09:14:04.924 +00:00] [INF] [89] Emby.Server.Implementations.ScheduledTasks.TaskManager: Executing "Played media cleanup"
[2023-02-23 09:14:05.301 +00:00] [ERR] [89] Emby.Server.Implementations.ScheduledTasks.TaskManager: Error
System.NullReferenceException: Object reference not set to an instance of an object.
   at Emby.Server.Implementations.Library.UserDataManager.GetUserData(User user, BaseItem item)
   at MediaCleaner.Filtering.FavoritesFilter.IsFavorite(User user, BaseItem item)
   at MediaCleaner.Filtering.FavoritesFilter.<>c__DisplayClass7_0.<Apply>b__0(User m)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at MediaCleaner.Filtering.FavoritesFilter.Apply(List`1 items)
   at MediaCleaner.JunkCollectors.BaseJunkCollector.Execute(List`1 users, IEnumerable`1 filters, CancellationToken cancellationToken)
   at MediaCleaner.MediaCleanupTask.ExecuteAsync(IProgress`1 progress, CancellationToken cancellationToken)
   at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)
[2023-02-23 09:14:05.603 +00:00] [INF] [89] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Played media cleanup" Failed after 0 minute(s) and 0 second

Troubleshooting info

No response

shemanaev commented 1 year ago

Please try this build.

MagnusL3D-code commented 1 year ago

I am not sure I know enough how to do that, running Jellyfin on a NAS through Docker :/ However if it is the regular 2.6.0.0 thats what I already have installed through regular updates

shemanaev commented 1 year ago

No worries, let's walk through this. You know where Jellyfin data located since you configured it in Docker? Like where you mounted /config. You go into that directory, then plugins, find Media Cleaner_2.6.0.0 and replace with files from archive.

However if it is the regular 2.6.0.0 thats what I already have installed through regular updates

It's from #16 with my attempt to fix this.

MagnusL3D-code commented 1 year ago

Allright, stopped the docker, copied the files over, and started the docker. Not sure what to do now, because I don't know how make it force run.

shemanaev commented 1 year ago

Go to admin dashboard in Jellyfin, then Scheduled Tasks, find Played media cleanup and run it.

MagnusL3D-code commented 1 year ago

Aha thanks for your patience with me ! =) Doesnt look good though. image

shemanaev commented 1 year ago

Would you mind go to Plugins -> Media Cleaner -> Troubleshooting tab and share log from there?

MagnusL3D-code commented 1 year ago

I would but it says: image

shemanaev commented 1 year ago

Oh, unfortunate...

MagnusL3D-code commented 1 year ago

is there anyway to rollback to 2.5.2.0 ? i see i have that and several earlier versions in my plugins folder

shemanaev commented 1 year ago

Let's try this build then.

shemanaev commented 1 year ago

is there anyway to rollback to 2.5.2.0

Yes, you should be able to do it from plugins Catalog. There you can select specific version. But it will not solve your problem :)

MagnusL3D-code commented 1 year ago

Allright tried the new zip and it still failed and error no troubleshooting error log :/

shemanaev commented 1 year ago

Ok, let's try to narrow down the possible errors. Could you set -1 to "Keep for" for Movies, Series and Videos in plugin settings one by one and check if there will be error for each section?

MagnusL3D-code commented 1 year ago

I already have all except Series on -1 Also I'd like to avoid testing with movies, incase it works and removes half of my movies because those i'd like to save =)

shemanaev commented 1 year ago

I already have all except Series on -1

It's already helpful. Let's repeat our testing with new build

MagnusL3D-code commented 1 year ago

It did run and it did remove several files. There is one it missed but I miiight have fiddled with that a bit much during testing so maybe I messed something up with it. AND!! The Troubleshooting log works! image

shemanaev commented 1 year ago

Nice. Thanks for debugging this case with me. No further actions required from you, plugin updates will be received as usual. If you'll encounter this issue again, feel free to reopen.

MagnusL3D-code commented 1 year ago

Allright ! thanks for all the help, so happy it works again ! =)

MagnusL3D-code commented 1 year ago

Just as a follow up, the one that didnt work, it appears I had favorited that show while trying to figure all this out. After removing favorite it got cleaned up correctly!