Skip to content

Commit 2eb5143

Browse files
committed
watched-sync.py: add option to config.py to exclude the admin
1 parent df5ccba commit 2eb5143

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

Contents/Scripts/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
'DataFolder': None,
1515
# PostersFolder (for collection-posters.py) requires double backslashes on windows e.g. "'PostersFolder': 'M:\\Anime\\Posters',"
1616
'PostersFolder': None,
17+
# SyncAdmin (for watched-sync.py)
18+
'SyncAdmin': True,
1719
# Alternate Plex authentication method (primarily for those using two-factor authentication)
1820
# https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
1921
'X-Plex-Token': ''

Contents/Scripts/watched-sync.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
- It must be a list to work e.g. "'LibraryNames': ['Anime Shows', 'Anime Movies']"
2222
- If you want to track watched states from managed/home accounts on your Plex server you can add them to Plex "ExtraUsers" following the same list format as above.
2323
- Leave it as "None" otherwise.
24+
- If you don't want to track watched states from your Plex Server's Admin account set "SyncAdmin" to "False".
25+
- Leave it as "True" otherwise.
2426
Usage:
2527
- Run in a terminal (watched-sync.py) to sync watched states from Plex to Shoko.
2628
- Append a relative date suffix as an argument to narrow down the time frame and speed up the process:
@@ -62,8 +64,8 @@ def arg_parse(arg):
6264
print(f'{error_prefix}Failed: Plex Credentials Invalid or Server Offline')
6365
exit(1)
6466

65-
# add the admin account to a list then append any other users to it
66-
accounts = [admin]
67+
# add the admin account to a list (if it is enabled) then append any other users to it
68+
accounts = [admin] if cfg.Plex['SyncAdmin'] else []
6769
if cfg.Plex['ExtraUsers']:
6870
try:
6971
extra_users = [admin.user(username) for username in cfg.Plex['ExtraUsers']]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ After installing the dependencies you must use a text editor to enter your Shoko
248248
- It must be a list to work e.g. `'LibraryNames': ['Anime Shows', 'Anime Movies']`
249249
- If you want to track watched states from managed/home accounts on your Plex server you can add them to Plex "ExtraUsers" following the same list format as above.
250250
- Leave it as "None" otherwise.
251+
- If you don't want to track watched states from your Plex Server's Admin account set "SyncAdmin" to "False".
252+
- Leave it as "True" otherwise.
251253

252254
**Usage:**
253255
- Run in a terminal `watched-sync.py` to sync watched states from Plex to Shoko.

0 commit comments

Comments
 (0)