Ok guys, the aspect ratio branch has finally been merged, together with a couple of other fixes.
0.7.9-prerelease1: script.plexmod.zip (2.8 MB)
Some background
Unlike Kodi skins, plugins bringing their own GUI don’t benefit from the modern features skins have, which means there’s no real support for anything other than 16:9.
Luckily, as we’re using the templating engine since 0.7.9-beta, we can dynamically build our GUI based on the display we’re seeing. In order to properly scale the UI for lower aspect ratios, such as 16:10 or 4:3, we still render our interface at 1080p (16:9) and let Kodi stretch it to the current display, but we vertically shrink and reposition our elements proportionally to the aspect ratio difference, so it looks exactly like it should in the end.
The logic is quite easy:
hratio = 1080 / float(1920)
hratio2 = h / float(w)
v_ar = hratio / hratio2
final_height = v_ar * height
This meant, though, that every single vertical position and height definition (and animations) in the GUI had to be checked and most of them replaced with the dynamically scaled counterparts, which was a ridiculous amount of work (luckily, 90 % of which could be realized by using smart regexes in PyCharm). I also had to expand the featureset of our templating engine (Ibis-fork) once again, which is why this took so long.
If you’re using a standard 16:9 aspect ratio, you will hopefully not notice anything using this release. Every 16:10/4:3 user should, though.
Widescreen (bigger aspect ratios) will come in the future, but scaling horizontally is a little more complicated.
Thanks @FortKnox1337 for sticking with me during the solution and execution phase over the last month or so!
Please report any issues you encounter!
Temporary Changelog:
- Core/GUI/Templating: Smaller aspect ratio support (16:10, 4:3, …)
- Core/MyPlex/UserSettings: Use cached user/account while waiting for plex.tv response; fixes episode playback errors with bingeMode setting
- Core/PlaybackManager: Allow ACCOUNT.ID to be None to not fail on pbs.bingeMode in certain (rare) situations
- Core/Networking/MyPlex: Adhere to max_retries when querying myplex; adhere to PLEXTV_TIMEOUT_READ (default: 20s) when doing so (used LONG_TIMEOUT=20 as a fixed value before)
- Core: Add singleton from tendo library; add LICENSE; make singleton py2 compatible (hopefully)
- Core/Main: Make absolutely sure we never run more than one instance at a time (via tendo.singleton locks)
- Core: Fix GlobalProperty context handler
- Core/Main: Round aspect ratio to 2 decimal points
- Core: Add info to splash in log whether we need scaling or not, and the current aspect ratio
- Episodes: Visually fix resume point still showing after rewinding to a non-resume-worthy point (<60s) in a video that had a resume point
- Music Libraries: Fix filters erroring
- Dropdown/Libraries: Fix visual scrolling issues on dropdowns with many items (e.g.: Genres)
- Dropdowns: Be smarter when we’re trying to display a dropdown that’s out of bounds
- Episodes: When watching multiple episodes in a row, completely, until the end of the season, select the last episode in the season when returning from playback
- Templating/Postplay: move hubs up a little (scaled)
- VideoPlayer/Postplay: Fix vertical positioning of hubs to be about the same as in Movie/Preplay view
- Player/SeekPlayerHandler: Possibly harden further against bad timeline events
- Player/Audio: Fix zero-duration error; fix seeking impossible
Edit: Oh yeah, this is prerelease1, and I forgot to ping The Squad™: @sonofdibnah @ecsjjgg @jamal2367 @THGhost @bowlingbeeg @Buttzy10169 @SmarthyMcFly @pl37919
Edit 2: Adding @FortKnox1337 to The Squad™