Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 9588b35

Browse files
committed
Trakktv: New role for Trak.tv plugin.
1 parent 6528763 commit 9588b35

File tree

3 files changed

+71
-2
lines changed

3 files changed

+71
-2
lines changed

cloudbox.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
- { role: sickbeard_mp4_automator, tags: ['cloudbox', 'feederbox', 'sickbeard_mp4_automator', 'sma'], when: ['sma_enabled'] }
4343
- { role: feeder, tags: ['feeder_mount', 'feeder_mount_override', 'feeder_unmount'] }
4444
- { role: plex_auth_token, tags: ['plex_auth_token'] }
45+
- { role: trakttv-plugin, tags: ['trakttv-plugin'] }
4546
- { role: sub-zero-plugin, tags: ['sub-zero-plugin', 'reinstall-sub-zero-plugin'] }
4647
- { role: webtools-plugin, tags: ['webtools-plugin', 'reinstall-webtools-plugin'] }
4748
- { role: subliminal, tags: ['subliminal'] }

roles/plex/tasks/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,18 @@
164164
mode: 0775
165165
recurse: yes
166166

167-
- name: "Install WebTools Plugin"
167+
- name: "Install Trakt.tv Plugin"
168168
import_role:
169-
name: webtools-plugin
169+
name: trakttv-plugin
170170

171171
- name: "Install Sub-Zero Plugin"
172172
import_role:
173173
name: sub-zero-plugin
174174

175+
- name: "Install WebTools Plugin"
176+
import_role:
177+
name: webtools-plugin
178+
175179
- name: "Forced Automatic Quality Settings"
176180
import_tasks: "subtasks/settings/forced_quality.yml"
177181
tags: plex_forced_quality
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#########################################################################
2+
# Title: Cloudbox: Trakt.tv Plugin #
3+
# Author(s): desimaniac #
4+
# URL: https://github.com/cloudbox/cloudbox #
5+
# -- #
6+
# Part of the Cloudbox project: https://cloudbox.works #
7+
#########################################################################
8+
# GNU General Public License v3.0 #
9+
#########################################################################
10+
---
11+
- name: Stop Plex container
12+
docker_container:
13+
name: plex
14+
state: stopped
15+
16+
- name: Remove Previous Trakt.tv Plugin
17+
file:
18+
path: "/opt/plex/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle"
19+
state: absent
20+
21+
- name: Get latest version available for Trakt.tv Plugin
22+
shell: curl -s https://api.github.com/repos/trakt/Plex-Trakt-Scrobbler/releases/latest | jq -r .tag_name
23+
args:
24+
warn: no
25+
register: trakttv_latest_version
26+
ignore_errors: yes
27+
28+
- name: Get latest Trakt.tv Plugin URL
29+
shell: |
30+
curl -s https://api.github.com/repos/trakt/Plex-Trakt-Scrobbler/releases/latest \
31+
| jq -r ".assets[] | select(.name | test(\"linux_x86_64\")) | .browser_download_url"
32+
args:
33+
warn: no
34+
register: trakttv_download_url
35+
ignore_errors: yes
36+
37+
- name: Set 'trakttv_download_url_backup' variable
38+
set_fact:
39+
trakttv_download_url_backup: https://github.com/trakt/Plex-Trakt-Scrobbler/releases/download/v1.3.3/trakt_for_plex-1.3.3-7f0f38e-linux_x86_64.zip
40+
41+
- name: Install Trakt.tv Plugin
42+
unarchive:
43+
src: "{{ trakttv_download_url.stdout | default('{{ trakttv_download_url_backup }}',true) }}"
44+
dest: "/opt/plex/Library/Application Support/Plex Media Server/Plug-ins"
45+
copy: no
46+
owner: "{{ user.name }}"
47+
group: "{{ user.name }}"
48+
mode: 0775
49+
validate_certs: no
50+
register: trakttv_install
51+
ignore_errors: yes
52+
53+
- name: Display Trakt.tv Plugin version
54+
debug:
55+
msg: "Trakt.tv Plugin version {{ trakttv_latest_version.stdout }} installed."
56+
when:
57+
- (trakttv_latest_version is defined) and (trakttv_latest_version is succeeded)
58+
- (trakttv_download_url is defined) and (trakttv_download_url is succeeded)
59+
- (trakttv_install is defined) and (trakttv_install is succeeded)
60+
61+
- name: Start Plex container
62+
docker_container:
63+
name: plex
64+
state: started

0 commit comments

Comments
 (0)