Closed Jusremo closed 1 year ago
I didn't test anything besides trigger_on_play and I don't know python, but this behavior is better for me when it comes to shows with different or non-existing subtitles, as well as the ability to sync "None/Off" when selected.
But I thought I'd throw the pull request up just in case you wanted to take a look.
Hi @Jusremo, thank you for your contribution !
I have two questions about you PR:
stopped
play sessions, the issue I have with this is that it may be triggered too late. Let's say that I manually update the language of an episode, then play it without stopping, then start the next episode at the end. The stopped
event is triggered immediately after the session ends but by the time Plex-Auto-Languages actually updates the language of the next episode, the play session has already started with the old settings.None
), Plex-Auto-Languages will only attempt to select a forced subtitles stream that matches the language of the audio stream. This is desired because forced subtitles are not consistent, you may have episodes with them and episodes without them. I'm curious to what this does not suit your needs ?Thank you again.
So for the first one, the problem I was having when playing something, was that if i set the streams while watching, and then skip to the next episode, the next episode's playing
would sometimes trigger before the previous episode's stopped
triggered, and the next episode's trigger would overwrite the settings. I think this only really happens if trigger_on_activity
is false.
Changing it the way I did introduced that bug, like you said, but it's more manageable for me. Unfortunately I couldn't come up with a better way to fix that, I'm too new to this, I was thinking maybe if the code for applying the streams was different for each trigger? But I don't really know.
I'm a little unclear on your second question, if you're asking about the syncing of None/Off
, I just wanted to be able to turn off subtitles for an entire series, I believe the previous behavior ignored my attempts to turn off subtitles, and re-enabled them upon revisiting the episode I turned them off for, (not sure if it was just from forced subtitles,) I didn't test that much.
I'm really a novice and was just tinkering though, opened this pull request just in case anyone wanted to take a look, thanks for checking it out and replying!
Selecting "None/Off" now syncs (only if there are other options.) trigger_on_play only triggers on "stopped" now to prevent a couple bugs.