RemiRigal / Plex-Auto-Languages

Automated language selection for Plex TV Shows !
MIT License
490 stars 18 forks source link

Subs no longer switch to "Off" if a matching subtitle isn't found. #70

Closed Jusremo closed 1 year ago

Jusremo commented 1 year ago

Selecting "None/Off" now syncs (only if there are other options.) trigger_on_play only triggers on "stopped" now to prevent a couple bugs.

Jusremo commented 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.

RemiRigal commented 1 year ago

Hi @Jusremo, thank you for your contribution !

I have two questions about you PR:

Thank you again.

Jusremo commented 1 year ago

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!