RemiRigal / Plex-Auto-Languages

Automated language selection for Plex TV Shows !
MIT License
428 stars 16 forks source link

Add forced subtitles matching based on audio language #42

Closed RemiRigal closed 2 years ago

RemiRigal commented 2 years ago

Forced subtitles can sometimes be available only for some episodes of a show. This leads to issue in cases like this:

Subtitles for episode 1:
  - English
  - English (Forced)
Subtitles for episode 2:
  - English
Subtitles for episode 3:
  - English
  - English (Forced)

Selecting English (Forced) on episode 1 will result in PAL correctly selecting the forced subtitles for episode 3 and nothing for episode 2. But when watching episode 2, PAL will deselect the force subtitles for episode 3, which is not the expected behavior.

This PR changes this by selecting the forced subtitles based on the language of the selected audio stream if no subtitles is selected for the current episode.

codecov-commenter commented 2 years ago

Codecov Report

Merging #42 (432628e) into master (2ea8b87) will increase coverage by 2.11%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
+ Coverage   93.75%   95.86%   +2.11%     
==========================================
  Files          18       18              
  Lines         961      968       +7     
==========================================
+ Hits          901      928      +27     
+ Misses         60       40      -20     
Flag Coverage Δ
claimed 95.86% <100.00%> (+2.11%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
plex_auto_languages/track_changes.py 96.90% <100.00%> (+10.81%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2ea8b87...432628e. Read the comment docs.