-
-
Notifications
You must be signed in to change notification settings - Fork 309
/
forced_quality_settings.yml
50 lines (44 loc) · 2.36 KB
/
forced_quality_settings.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
##########################################################################
# Title: Plex - Forced Automatic Quality Settings #
# Author(s): desimaniac #
# URL: https://github.com/cloudbox/cloudbox #
# -- #
# Part of the Cloudbox project: https://cloudbox.works #
##########################################################################
# GNU General Public License v3.0 #
##########################################################################
# Based on the work by Michael Zemsky (https://github.com/zmike808) #
##########################################################################
---
- name: Install lxml pip module
pip: "name=lxml state=present"
- name: Wait for 'Preferences.xml' to be created by Plex
wait_for:
path: "/opt/plex/Library/Application Support/Plex Media Server/Preferences.xml"
state: present
# 'forceAutoAdjustQuality' in Preferences.xml - Forces clients to use automatic quality for media unless the quality is set higher than the quality of the video.
- name: "Set 'forceAutoAdjustQuality' in 'Preferences.xml' to '{{ (plex.force_auto_adjust_quality|default(false,true)) | ternary('Enabled','Disabled') }}'."
xml:
path: "/opt/plex/Library/Application Support/Plex Media Server/Preferences.xml"
xpath: /Preferences
attribute: forceAutoAdjustQuality
value: "{{ (plex.force_auto_adjust_quality|default(false,true)) | ternary('1','0') }}"
state: present
register: x
ignore_errors: yes
# 'AllowHighOutputBitrates' in Preferences.xml - Forces transcode quality to upscale. But can cause high bandwidth usage for clients.
- name: "Set 'AllowHighOutputBitrates' in 'Preferences.xml' to '{{ (plex.force_high_output_bitrates|default(false,true)) | ternary('Enabled','Disabled') }}'."
xml:
path: "/opt/plex/Library/Application Support/Plex Media Server/Preferences.xml"
xpath: /Preferences
attribute: AllowHighOutputBitrates
value: "{{ (plex.force_high_output_bitrates|default(false,true)) | ternary('1','0') }}"
state: present
register: y
ignore_errors: yes
- name: Restart plex container
docker_container:
name: plex
state: started
restart: yes
when: x.changed or y.changed