Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Update new files as they are added #26

Closed
rg9400 opened this issue Apr 29, 2022 · 11 comments
Closed

[Feature Request] Update new files as they are added #26

rg9400 opened this issue Apr 29, 2022 · 11 comments
Labels
enhancement New feature or request

Comments

@rg9400
Copy link

rg9400 commented Apr 29, 2022

I am not sure if this increases the scope or complexity of the app, but I noticed PlexAutoLanguages works super well when I have a full season/show available on Plex. However, for currently airing items, it doesn't track new files as they are added to Plex. There are two scenarios

  1. A completely new episode is added
  2. An existing episode file is upgraded. Let's take a scenario where I am watching an anime. I have subbed releases, but they are being replaced by dual audio files as those are released, which usually lag behind by a few weeks. If I play the first dual audio release using the dub tracks, it won't find those dubbed tracks for the rest of the season, but as a new dual audio file is added, those tracks could now theoretically be selected.

I realize this may not be easy to do. Currently, it seems you are just updating the languages given a trigger, so you don't need to keep track of the sub/language selection beyond the update. But in this scenario, if a new file is added, you would need to A) know the file is added which includes both as new episodes as well as replacements of existing files and B) know which tracks to select

However, I figured I would create a GHI to at least initiate the discussion

@RemiRigal RemiRigal added the enhancement New feature or request label Apr 29, 2022
@RemiRigal
Copy link
Owner

RemiRigal commented Apr 29, 2022

Thank you for opening an issue !

I have added support for completely new episodes in version v1.0.11. Whenever a new episode is added, PlexAutoLanguages will perform a language update for all users based on:

  • The most recently watched episode of the show by the user
  • The first episode of the show if it has never been watched by the user

If you are already running this version and experience issues with this please let me know.

However the upgrade of an existing episode (file upgrade or new additional file) is not yet supported. I will work on it !

@rg9400
Copy link
Author

rg9400 commented Apr 29, 2022

This seems to be working, will test further. One question is if it is possible to maybe exclude this case from notifications? If not, I will need to turn them off as each new episode added generates multiple notifications now, one per user 😅

@BEisem
Copy link
Contributor

BEisem commented Apr 29, 2022

I was just coming to post an error, but it seems that it is related to this new feature. When a new episode is added, I get the following error:

2022-04-29 12:16:14,350 [INFO] Processing newly added episode 'Nick Knowles' Big House Clearout' (S01E06)
2022-04-29 12:16:26,891 [ERROR] Unable to process timeline
Traceback (most recent call last):
  File "main.py", line 176, in process_timeline_message
    self.process_timeline(timeline)
  File "main.py", line 213, in process_timeline
    user_item = user_plex.fetchItem(item_id)
  File "/usr/local/lib/python3.8/site-packages/plexapi/base.py", line 173, in fetchItem
    data = self._server.query(ekey)
  File "/usr/local/lib/python3.8/site-packages/plexapi/server.py", line 680, in query
    raise NotFound(message)
plexapi.exceptions.NotFound: (404) not_found; http://localhost:32400/library/metadata/644158 <html><head><title>Not Found</title></head><body><h1>404 Not Found</h1></body></html>

@RemiRigal
Copy link
Owner

This seems to be working, will test further. One question is if it is possible to maybe exclude this case from notifications? If not, I will need to turn them off as each new episode added generates multiple notifications now, one per user 😅

@rg9400 If you want to get more information on what's going on I have added a debug mode that you can enable by setting the parameter debug to true as mentioned here. The feature is only available in the master branch for now though.

About notifications, you are raising a good point, this will be extremely annoying for people having a lot of users. I will think about a good way to tackle this. Thank you for the suggestion 👍


I was just coming to post an error, but it seems that it is related to this new feature. When a new episode is added, I get the following error

@BEisem Can you try the latest version ?

@BEisem
Copy link
Contributor

BEisem commented Apr 29, 2022

@RemiRigal I'm already on the latest version, is there a new docker build that is still pending? I've tried pulling but nothing new is showing up.

@RemiRigal
Copy link
Owner

@RemiRigal I'm already on the latest version, is there a new docker build that is still pending? I've tried pulling but nothing new is showing up.

Apologies, I forgot to change something earlier, should be better with version v1.0.14. Thank you for your patience !

@RemiRigal
Copy link
Owner

@rg9400 Version v1.0.15 comes with an improved notification system. There will only be one notification per newly added episode, and you can now choose to receive notifications only for specific users.
See the documentation for more details.

@BEisem
Copy link
Contributor

BEisem commented May 1, 2022

This is a great update, thank you for addressing this!

@RemiRigal
Copy link
Owner

Good news, I've merged PR #34 that adds support for updated episodes ! The feature has been released with version v1.1.0.

A language update is triggered whenever the files of an episode change, so:

  • A new file is added
  • A file is renamed
  • A file is deleted

You should then see something like this in the logs:
2022-05-02 17:50:49,221 [INFO] [Status] Processing updated episode 'Mindhunter' (S02E04)

@rg9400
Copy link
Author

rg9400 commented May 4, 2022

This seems to be working based on some initial testing. One additional request I had (let me know if you want to open up a GHI) is to still give a bit more flexibility with the notifications. I appreciate being able to condense it to All Users for new episodes and to also suppress specific users. But if I want notifications on, the new files are basically creating notifications for every new file and upgrade, which creates a lot of noise. These aren't super useful and serve as more passive updates based on selections the user may have made in the past. So ideally, being able to only see notifications based on active triggers would be ideal.

@RemiRigal
Copy link
Owner

Sure ! I can add more settings for the notifications. A separate GHI would be better in my opinion, could you open one please ?

I think we can close this issue. Feel free to reopen it if you experience any issues with the processing of new/updated episodes !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants