contrary-cat / LocalTVExtras.bundle

Local TV Extras Agent for Plex
82 stars 9 forks source link

Show Extras not being removed? #15

Open ghost opened 4 years ago

ghost commented 4 years ago

Great plugin, thank you!

I added some extras at the show level to test, then after confirming it worked, I reorganized into season level extras.

The show level extras remained, despite their files being moved. These should probably get deleted by the plugin on metadata refresh.

contrary-cat commented 3 years ago

Sorry for the delay in replying – real life took over at the end of last year, and so I’ve let some things slip.

It is intended to work the way you said, as long as the settings have been changed to add shows to seasons, etc. then moving the location to season folders should result in them being deleted from the show level after a metadata refresh.

You might have already fixed your issue, but let me know if you still need help

jpschewe commented 3 years ago

My extras are showing up at the show level rather than the season level. What information can I provide to help debug this?

contrary-cat commented 3 years ago

In Plex, go to Settings > Agents > Shows, and look in the Local TV Extras agent settings; make sure that you have Assign Extras to Episodes, Seasons or Shows based on folder structure selected.

If it already is, then you may have run into a known issue – if any of the season folders within your show aren't properly recognised as a season, then it falls back to assigning everything to the show level. You can work around this by adding the problem folder name to Alternative names for season folders, comma separated in the settings.

If you think that is the issue, but aren't sure which folder is the problem, then you can attach the log file. You'll have to find this manually rather than downloading from Plex (they only include first-party logs in the download).

You can find the location for your system at this link: Plex Media Server Logs. The log file is named com.plexapp.agents.localtvextras.log, and it will be in the PMS Plugins subfolder.

A new one is created every time you restart the server; so to be safe, you should refresh metadata on one of the problem shows before uploading the file.

jpschewe commented 3 years ago

OK, I did not have that option checked. I've done that now and forced a refresh on the metadata. I still see the extras listed at the top. For example I have "The Dukes of Hazzard/Season 01/Behind The Scenes/John Schneider and Tom Wopat Screen Tests.m4v". That video is showing up on the show page, but not on the Season 01 page.

com.plexapp.agents.localtvextras.log

contrary-cat commented 3 years ago

@jpschewe I've had a look at the log, but it looks there as if the extras were being assigned at season level. I see the line Searching for extras for season 1, which is only logged when the agent is adding extras to metadata.seasons[number] rather than the show metadata. And the video you mentioned (among others) is added to that season.

Which client are you using to check for the extras?

jpschewe commented 3 years ago

I am using the web client. The server says version 4.47.3. It's installed via snap on Ubuntu Linux.

Looking at a portion of the log

2021-01-24 07:57:34,353 (7f6c37fff700) :  INFO (__init__:123) - Looking for local extras in path: /mnt/data/plex/tv-shows/The Dukes of Hazzard/Season 01
2021-01-24 07:57:34,353 (7f6c37fff700) :  INFO (__init__:123) - John Schneider and Tom Wopat Screen Tests.m4v
2021-01-24 07:57:34,353 (7f6c37fff700) :  INFO (__init__:123) - Dukes Driving 101: A High Octane Salute.m4v
2021-01-24 07:57:34,353 (7f6c37fff700) :  INFO (__init__:123) - The 20th Anniversary Hazzard County Barbeque.m4v
2021-01-24 07:57:34,354 (7f6c37fff700) :  INFO (__init__:135) - added 0 extras

I see this ending with "added 0 extras".

contrary-cat commented 3 years ago

The web client only displays extras linked to the show, you'll need one of the clients listed in the README that support show & season to see the linked Season 1 extras.

This is the part of the log where the season extras are added:

2021-01-23 17:01:44,429 (7f2e1ffff700) :  INFO (__init__:31) - Season 01 is a Season Folder
2021-01-23 17:01:44,430 (7f2e1ffff700) :  INFO (__init__:174) - Searching for extras for season 1
2021-01-23 17:01:44,430 (7f2e1ffff700) :  INFO (__init__:124) - Looking for local extras in path: /mnt/data/plex/tv-shows/The Dukes of Hazzard/Season 01
2021-01-23 17:01:44,430 (7f2e1ffff700) :  INFO (__init__:124) - John Schneider and Tom Wopat Screen Tests.m4v
2021-01-23 17:01:44,430 (7f2e1ffff700) :  INFO (__init__:56) - Found behindthescenes extra: John Schneider and Tom Wopat Screen Tests
2021-01-23 17:01:44,431 (7f2e1ffff700) :  INFO (__init__:124) - Dukes Driving 101: A High Octane Salute.m4v
2021-01-23 17:01:44,431 (7f2e1ffff700) :  INFO (__init__:56) - Found featurette extra: Dukes Driving 101: A High Octane Salute
2021-01-23 17:01:44,431 (7f2e1ffff700) :  INFO (__init__:124) - The 20th Anniversary Hazzard County Barbeque.m4v
2021-01-23 17:01:44,431 (7f2e1ffff700) :  INFO (__init__:56) - Found featurette extra: The 20th Anniversary Hazzard County Barbeque
2021-01-23 17:01:44,432 (7f2e1ffff700) :  INFO (__init__:133) - /mnt/data/plex/tv-shows/The Dukes of Hazzard/Season 01/Behind The Scenes/John Schneider and Tom Wopat Screen Tests.m4v
2021-01-23 17:01:44,432 (7f2e1ffff700) :  INFO (__init__:133) - /mnt/data/plex/tv-shows/The Dukes of Hazzard/Season 01/Featurettes/Dukes Driving 101: A High Octane Salute.m4v
2021-01-23 17:01:44,433 (7f2e1ffff700) :  INFO (__init__:133) - /mnt/data/plex/tv-shows/The Dukes of Hazzard/Season 01/Featurettes/The 20th Anniversary Hazzard County Barbeque.m4v
2021-01-23 17:01:44,433 (7f2e1ffff700) :  INFO (__init__:135) - added 3 extras
2021-01-23 17:01:44,433 (7f2e1ffff700) :  INFO (__init__:136) - finished

It says 'added 0 extras' at that later point in the log because at that point it was looking for show extras, but those files were already listed as season extras, so they aren't added twice.

Although they won't display in the web client, you can check the XML API to confirm they have been added - it's a bit of a fuss to do manually, but here's the steps:

jpschewe commented 3 years ago

It would help if I read your documentation. Sorry about that. What is see right now is the following:

Is this what you expect?

contrary-cat commented 3 years ago

No, once the extras were moved, I'd expect that they would disappear from the show level. I'll try to make a similar example show and see if I can reproduce the problem.

Since the files were moved, could you try playing one of the extras linked to the show? If it works, then (likely) the new location was also linked to the show level; and if it doesn't work, then the old location wasn't unlinked for some reason.

jpschewe commented 3 years ago

To be clear, I didn't move the files. The files were always located under the Season directory. The change that I made was to check the box in the settings.

A further question, if I have the extras associated with the season and I'm using a client that doesn't support extras by season (the web client), will that client see the extras at the show level?

contrary-cat commented 3 years ago

Thanks for clarifying - I'll change my test case then, since the show linked extras should still have disappeared.

Unfortunately the web client (and other clients that only support show extras) don't work that way, if the extras are linked to the season, then they won't be seen at all by the web client.

Some people have requested that I add an option that deliberately links all extras to the show as well as seasons/episodes. That will probably take a bit of thought in the design, since it would be best to identify which season it belongs to when linking to the show. I haven't had much spare time to work on this agent, but it is on the to-do-list.

contrary-cat commented 3 years ago

The test case confirms what you observed, if the settings are changed, but the extras are in the same place, then they still stay linked to the show as well as the season. There also seems to be a general problem with deleting extras: if all of the extras in a particular location are removed at the same time, then Plex doesn't unlink them in the database.

I think this is a server problem rather than something specific to this agent. I've also tested it out on a movie (using the old Plex Movie agent). If there are internet extras added by the Plex Movie agent, then it's possible to add and delete local extras properly. But if there aren't any separate internet extras then deleting the local extras won't work.

At the moment, I think it would take a full Plex dance to remove all of the extras that have been linked (if you do want to unlink them from the show).

jpschewe commented 3 years ago

I understand the spare time part, I have the same issue with my projects.

Given the issues with which clients support extras where, I like the situation where I am currently at. The extras linked to the show and the season. Then clients that don't understand the season extras can still reach them via the show.