shemanaev / jellyfin-plugin-media-cleaner

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

"Delete after entire season played" currently broken? #6

Closed blackwind closed 1 year ago

blackwind commented 1 year ago

We finished a season of a show on September 4th I'd like Media Cleaner to delete. I have Media Cleaner configured to delete 10 days after an entire season has been watched. It's September 18th now, and the season still hasn't been deleted. I've verified the scheduled task is running regularly and has run multiple times since the 10-day mark. None of the episodes are marked as favorites, but the README indicates this shouldn't matter in season mode, and I don't have "Keep favorites" enabled either way. I'm using location inclusion mode, and the show in question is located in the folder I have whitelisted. Running the latest version of the plugin, 2.4.0.0, on Jellyfin 10.8.4. This is either a bug, or I need clarification on how this particular feature works.

shemanaev commented 1 year ago

Yes, your observations are correct, something definitely gone wrong. I'll look into it asap.

shemanaev commented 1 year ago

@blackwind could you test this fresh build?

blackwind commented 1 year ago

Alright, so according to the debug log, the problem appears to be that I've watched the shows I want deleted at two different apartments using a different Jellyfin account at each location, which then get their progress synced via the Trakt plugin, and I just took for granted that Media Cleaner would see a fully marked as watched season as completed, but it only takes into account real watches logged from each particular account, not watches marked by the Trakt plugin. I've deleted the extra account, unmarked and remarked the episodes I want deleted under my main account, and they now show up in the debug log as watched and, I assume, should be deleted as expected now in 10 days. User error, my bad. Thanks for the debug build!

shemanaev commented 1 year ago

Good to know. It's strange that Trakt marked episodes doesn't count, I'll experiment with that in my free time.

blackwind commented 1 year ago

Alright, the Trakt marked episodes problem is becoming quite annoying as I tend never to watch an entire season in one place and Media Cleaner never cleans up my media. Reopening this. Can you take another look, Denis?

shemanaev commented 1 year ago

From the code itself, all looks fine. Alright, let's start from the ground up. Is the episodes marked from Trakt shows up on the "Troubleshooting" tab of the plugin? If so, could you post relevant bits?

blackwind commented 1 year ago

It's weird, I've been using Plex since the beginning of the year and just keeping Jellyfin online a.) just in case I have trouble with Plex at some point and b.) because it doesn't appear anyone's written anything comparable to Media Cleaner for Plex and this is a critical feature for me. According to the log, it's picked up two of my watches since I switched to Plex, definitely neither of which were watched on Jellyfin.

[Tra] JunkCollectors.SeriesJunkCollector: Collecting played items for 1 users started at 01/27/2023 10:49:09
[Deb] ItemsAdapter: "Langley Dollar Listings" played by "Matt" (01/21/2023 16:57:00)
[Deb] ItemsAdapter: "Love Story Guy" played by "Matt" (01/09/2023 19:22:20)
[Deb] ItemsAdapter: "Everlight" played by "Matt" (12/31/2022 09:34:01)

So it has the ability to recognize a select few pulls from Trakt for some reason, but not the other 40+ episodes I've watched since New Year's. I can't fathom any particular method to the madness at the moment.

blackwind commented 1 year ago

I should also note that I've confirmed the Trakt plugin is correctly mirroring watched statuses in Jellyfin, so it doesn't seem to be a problem on their end. Everything that I've watched in Plex is correctly mirrored in the Jellyfin interface, just not in Media Cleaner.

shemanaev commented 1 year ago

I think maybe something wrong with dates sync. Try to gather "troubleshooting" logs with this build.

blackwind commented 1 year ago

Nailed it, this seems to be a full list of what's getting missed:

[War] ItemsAdapter: "Années Folles" (fdb1eec6-e4fd-41f3-93ee-8a8b2b65d422) marked as played but has not date
[War] ItemsAdapter: "Dressed Down" (f9c18642-55a6-7210-af48-1f578e4a32a2) marked as played but has not date
[War] ItemsAdapter: "American Dad Graffito" (f41e6780-f4a0-09dc-873c-6ec8e8179aff) marked as played but has not date
[War] ItemsAdapter: "Through the Looking Glass" (f3bea815-98e5-88ac-4856-43c11f36a83c) marked as played but has not date
[War] ItemsAdapter: "To Catch a Mouse" (e46e5384-8ba3-6037-2e56-7f26290352b6) marked as played but has not date
[War] ItemsAdapter: "Plan and Execution" (e438fcc3-18f6-5844-779b-a2b899961266) marked as played but has not date
[War] ItemsAdapter: "Hit and Run" (e01f8180-5e4d-f757-e7d2-9affcacb5598) marked as played but has not date
[War] ItemsAdapter: "Black and Blue" (df8b9a88-5492-5d79-7d0c-1724d9f3a09d) marked as played but has not date
[War] ItemsAdapter: "I Exist" (de24744f-1039-5c99-6512-6b1b6998c855) marked as played but has not date
[War] ItemsAdapter: "Across the Universe" (d9f442f5-f6ce-f0f5-c50c-4177facaabdd) marked as played but has not date
[War] ItemsAdapter: "Buffalo Chicken Pizza" (d79fe8eb-1ee5-3628-502b-5e6d5695b6b2) marked as played but has not date
[War] ItemsAdapter: "Saul Gone" (d3e8516e-d581-ebdc-76c3-73678c4c27d1) marked as played but has not date
[War] ItemsAdapter: "Chapter 13" (cd47b87d-c1bf-eb08-b217-f59fb67e259c) marked as played but has not date
[War] ItemsAdapter: "The 12 Hours of Christmas" (c077a789-1bee-3bf1-5251-1c49dbaae4e3) marked as played but has not date
[War] ItemsAdapter: "The Platinum Beyblade Burst 800 Takara Tomy Edition" (bc401743-6248-e31d-c0c3-58ad2fd94e49) marked as played but has not date
[War] ItemsAdapter: "Chapter 11" (b611e8a8-c221-8edf-2d55-22710c8dadb7) marked as played but has not date
[War] ItemsAdapter: "Well Enough Alone" (b1c63371-c4d5-662a-5ad9-58d3467610d7) marked as played but has not date
[War] ItemsAdapter: "Roman Candle" (b1c2fb96-6899-9d04-8bcd-17ade0b70da2) marked as played but has not date
[War] ItemsAdapter: "TBA" (b0cf69a1-6821-e0cf-52c9-49de710880e6) marked as played but has not date
[War] ItemsAdapter: "Crushing It" (afdee3de-afcf-a4e3-4e12-fbccc4ed2ad2) marked as played but has not date
[War] ItemsAdapter: "Hair of the Dog" (abbec044-eb8b-bada-6c71-d94284f07321) marked as played but has not date
[War] ItemsAdapter: "JuRicksic Mort" (a7328f72-0931-e39f-14da-17a2a1c22640) marked as played but has not date
[War] ItemsAdapter: "Aubrey Plaza / Sam Smith" (a706cbf6-a1e6-de67-d4e6-3b7979ba435b) marked as played but has not date
[War] ItemsAdapter: "Chapter 12" (a68d1738-fd5c-241d-5468-9870033b62af) marked as played but has not date
[War] ItemsAdapter: "Chapter 2" (a3f9b6a8-7295-3b1a-7abb-7a89be286f20) marked as played but has not date
[War] ItemsAdapter: "Fidelity" (a3c8c5cb-a771-d47f-23b3-af2c7eb95720) marked as played but has not date
[War] ItemsAdapter: "The Two Joes" (a2e760d7-41ac-1f13-b0cb-ca48d9cfae19) marked as played but has not date
[War] ItemsAdapter: "Chapter 14" (9e6aeb43-9bb5-ffbe-4d06-4eedb9e59d20) marked as played but has not date
[War] ItemsAdapter: "The Pupa’s Big Day" (9560e2cf-50cb-3b9f-78dc-b0372f4aa875) marked as played but has not date
[War] ItemsAdapter: "The Year of Phil" (943a9753-d229-e44d-0eeb-4fcd18f72742) marked as played but has not date
[War] ItemsAdapter: "Playpen" (8f7faeef-1059-1ed0-77e3-be35378bb2b8) marked as played but has not date
[War] ItemsAdapter: "Beyond the Alcove or: How I Learned to Stop Worrying and Love Klaus" (8edef551-a0e7-0232-0bb2-d17762f8dd99) marked as played but has not date
[War] ItemsAdapter: "Rebirthday" (8850f757-ca13-9611-f28f-df9a46854922) marked as played but has not date
[War] ItemsAdapter: "The Curious Case of the Old Hole" (8416e96c-e59d-0555-fe09-195ce38c6430) marked as played but has not date
[War] ItemsAdapter: "Fun and Games" (7e643fea-2af1-8230-9804-513d4718694d) marked as played but has not date
[War] ItemsAdapter: "Chapter 8" (78167ccf-4573-b6e0-4c3d-50aeb8057eae) marked as played but has not date
[War] ItemsAdapter: "Rex Igneous" (76100e47-1ebf-9327-be2e-01e51a4e0073) marked as played but has not date
[War] ItemsAdapter: "Chapter 3" (6d7a8f65-d6e8-1dc2-1a8f-e9bff9628535) marked as played but has not date
[War] ItemsAdapter: "Epic Powder Dump" (6c2e0a32-c28b-3788-1b2b-5632018826c4) marked as played but has not date
[War] ItemsAdapter: "Que Será, Será" (699ce53c-c7c1-4924-715e-43bdb60ad9d6) marked as played but has not date
[War] ItemsAdapter: "Episode 7" (66fea73b-6801-aafc-7142-442c8b2ac82e) marked as played but has not date
[War] ItemsAdapter: "The Great Gates" (65260b3a-0b1c-5850-d540-ca3fc0f35888) marked as played but has not date
[War] ItemsAdapter: "Waterworks" (610d1afe-8d6d-3927-74ef-20112b618c79) marked as played but has not date
[War] ItemsAdapter: "Tadpole Smoothie" (5f8e99a2-cc48-41e7-1ce9-4534c3137b02) marked as played but has not date
[War] ItemsAdapter: "Seven" (5d65eb9c-97a8-3fbe-a62c-282ca09ead1d) marked as played but has not date
[War] ItemsAdapter: "Metanoia" (5b49c999-f7b5-9148-7e68-218777e5738c) marked as played but has not date
[War] ItemsAdapter: "Nippy" (5843fb5e-3a2f-641f-5013-0124f3c7f32a) marked as played but has not date
[War] ItemsAdapter: "Chapter 7" (577f18ab-4962-5b8e-8ecb-b2552cec0480) marked as played but has not date
[War] ItemsAdapter: "Escape from Umber Tor" (55ff1a70-d8c8-4218-1fa1-d52bb61d6fce) marked as played but has not date
[War] ItemsAdapter: "A Song of Knives and Fire" (545123da-6aa4-18af-76f2-114d8a730eba) marked as played but has not date
[War] ItemsAdapter: "Point and Shoot" (4d291e38-e91d-c640-c8a9-0066d46653da) marked as played but has not date
[War] ItemsAdapter: "The Book of Fischer" (47d7f598-b554-fb06-5d8d-c131643d94df) marked as played but has not date
[War] ItemsAdapter: "Rock and Hard Place" (47a8f287-ed95-4ef3-2d63-6693a19870bc) marked as played but has not date
[War] ItemsAdapter: "Chapter 1" (4387a841-370e-2aa5-f425-5b5202cb3635) marked as played but has not date
[War] ItemsAdapter: "TBA" (3c42feb3-7e68-84cb-f21f-b9b084257f8f) marked as played but has not date
[War] ItemsAdapter: "Partners" (3b9433bc-22fe-f131-2af0-4b4673860f97) marked as played but has not date
[War] ItemsAdapter: "Breaking Bad" (3799edfb-5c7f-e8ef-1ed8-9cbb92b002de) marked as played but has not date
[War] ItemsAdapter: "Gold Top Nuts" (2fed4e0f-083f-51d2-b77b-d433f1c60fa4) marked as played but has not date
[War] ItemsAdapter: "Fallen Stars" (2ecaf8c0-be51-f55e-b3fb-c6aa64f06cda) marked as played but has not date
[War] ItemsAdapter: "The Princess and the Queen" (2940ad6f-7df0-36d3-7c33-8114910ba9d4) marked as played but has not date
[War] ItemsAdapter: "A Roger Story" (25770b41-5638-cc43-bdbb-feab39c1e636) marked as played but has not date
[War] ItemsAdapter: "Chapter 9" (1f874b50-fbcd-8de3-5feb-e7dcd42367a9) marked as played but has not date
[War] ItemsAdapter: "The Candidate" (1d70b1a3-9a67-6125-7a92-9d146e1080e9) marked as played but has not date
[War] ItemsAdapter: "Final DeSmithation" (1be3f45e-27e5-55f1-d396-68a54d179c0b) marked as played but has not date
[War] ItemsAdapter: "Generation Loss" (1ad6e1ce-a52c-0e28-c531-94908cd99ccc) marked as played but has not date
[War] ItemsAdapter: "Breathtaking" (193d0a6c-9d38-3caa-11d5-c8ed264fcfe4) marked as played but has not date
[War] ItemsAdapter: "Chapter 5" (18c0976b-4083-2501-0b3c-298c2fcf3c7c) marked as played but has not date
[War] ItemsAdapter: "The Gargoyle Ray" (13ffa670-978d-5efe-2531-7fef95c89389) marked as played but has not date
[War] ItemsAdapter: "The Auguries" (13cdeeca-93e0-0395-d53d-092776276476) marked as played but has not date
[War] ItemsAdapter: "Chapter 10" (104dcd81-b492-2910-aa36-7c8a36c43c6b) marked as played but has not date
[War] ItemsAdapter: "Sarian" (0d6f23f0-a995-1d96-6b7e-72704c3e0758) marked as played but has not date
[War] ItemsAdapter: "Carrot and Stick" (0c5444f7-bb4b-3e14-d845-eecccf4389b1) marked as played but has not date
[War] ItemsAdapter: "Long Table, VoChill, JicaFoods, Kudos" (06aa7eed-e618-b5b1-a690-ed9141a39d94) marked as played but has not date
[War] ItemsAdapter: "Hululand" (05d62e65-69a5-f9ba-8c51-026c4c58e517) marked as played but has not date
[War] ItemsAdapter: "Chapter 4" (048fee05-cea8-93d1-7c8f-d8f57f672155) marked as played but has not date
[War] ItemsAdapter: "Zhuangzi" (038115c3-d7f1-2082-3d0b-eba2c8a05d0f) marked as played but has not date
[War] ItemsAdapter: "Beneath the Surface" (028d0855-cca3-8b71-9d24-6ebf0d3d1dd1) marked as played but has not date
[War] ItemsAdapter: "Axe and Grind" (01b380db-8e7e-4256-4c5c-1cd82d6ded0c) marked as played but has not date
[War] ItemsAdapter: "The Drakewood" (003a04aa-6ced-1012-4d17-4e7dced9863c) marked as played but has not date
shemanaev commented 1 year ago

Trakt plugin to be blamed then 😄. Without a correct LastPlayedDate I can't do much, obviously.

blackwind commented 1 year ago

Technically you could apply a date of [current time] when first discovering a play without a date, but I agree this is something that should be handled on their end. Would you be so kind as to file the issue with them since you know exactly what's going wrong and exactly what needs to be done to fix it?

shemanaev commented 1 year ago

know exactly what's going wrong and exactly what needs to be done to fix it

I actually don't. I know only that played date doesn't sync from Trakt to Jellyfin.

And since I can't replicate the issue, it would be better to do that yourself. But before that, it would be great to collect relevant logs. To do this, first enable debug logging, then run "Sync from Trakt" scheduled task. Jellyfin log should have a lot of info about sync process by then.

blackwind commented 1 year ago

I submitted a fix for the Trakt plugin and it'll be included in the next release. Everything is working as expected now. Thanks for helping debug this one!