Skip to content

Commit f5a20d1

Browse files
committed
Account for v3 API Now Returning the Preferred Poster First
- incidentally fixes a bug introduced here: 28ba49a (thanks to flashmeow for reporting) - option spacing - bump versions
1 parent 8b00f3f commit f5a20d1

5 files changed

Lines changed: 7 additions & 10 deletions

File tree

Contents/Code/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def ValidatePrefs():
66
pass
77

88
def Start():
9-
Log('======================[Shoko Relay Agent v1.2.10]======================')
9+
Log('======================[Shoko Relay Agent v1.2.11]======================')
1010
HTTP.Headers['Accept'] = 'application/json'
1111
HTTP.ClearCache() # Clear the cache possibly removing stuck metadata
1212
HTTP.CacheTime = 0.1 # Reduce the cache time as much as possible since Shoko has all the metadata
@@ -192,11 +192,8 @@ def Update(self, metadata, media, lang, force):
192192
# Get Posters & Backgrounds
193193
if Prefs['addEveryImage']:
194194
series_images = HttpReq('api/v3/Series/%s/Images?includeDisabled=false' % series_id) # http://127.0.0.1:8111/api/v3/Series/24/Images?includeDisabled=false
195-
posters, backgrounds = try_get(series_images, 'Posters', []), try_get(series_images, 'Backdrops', [])
196-
for poster in [p for p in posters if poster['Preferred']]: posters.insert(0, posters.pop(posters.index(poster))) # Move preferred poster to the top of the list
197-
self.image_add(metadata.posters, posters, '(Poster): ')
198-
for background in [b for b in backgrounds if backdrop['Preferred']]: backgrounds.insert(0, backgrounds.pop(backgrounds.index(background))) # Move preferred backdrop to the top of the list
199-
self.image_add(metadata.art, backgrounds, '(Background): ')
195+
self.image_add(metadata.posters, try_get(series_images, 'Posters', []), '(Poster): ')
196+
self.image_add(metadata.art, try_get(series_images, 'Backdrops', []), '(Background): ')
200197
else: # Series data only contains the preferred image for each type
201198
self.image_add(metadata.posters, try_get(series_data['Images'], 'Posters', []), '(Poster): ')
202199
self.image_add(metadata.art, try_get(series_data['Images'], 'Backdrops', []), '(Background): ')

Contents/DefaultPrefs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116

117117
{
118118
"id": "sanitizeSummary",
119-
"label": "The degree to which the summary is cleansed of extraneous info ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ This includes lines starting with general info (\"Source: \", \"Note: \", \"Summary: \"), as well as other miscellaneous lines (\"* \", \"\", \"- \", \"~ \").",
119+
"label": "The degree to which the summary is cleansed of extraneous info ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ This includes lines starting with general info (\"Source: \", \"Note: \", \"Summary: \"), as well as other miscellaneous lines (\"* \", \"\", \"- \", \"~ \").",
120120
"type": "enum",
121121
"values" : ["Fully Sanitize", "Allow Info Lines", "Allow Misc. Lines", "Allow Both Types"],
122122
"default": "Fully Sanitize"

Contents/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<key>CFBundleName</key>
66
<string>Shoko Relay</string>
77
<key>CFBundleVersion</key>
8-
<string>1.2.10</string>
8+
<string>1.2.11</string>
99
<key>CFBundleIdentifier</key>
1010
<string>com.plexapp.agents.shokorelay</string>
1111
<key>PlexClientPlatforms</key>

Contents/Scanners/Series/Shoko Relay Scanner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def Scan(path, files, mediaList, subdirs, language=None, root=None):
7373
if files : Log.debug('[Files] %s' % ', '.join(files))
7474

7575
for subdir in subdirs: Log.debug('[Folder] %s' % os.path.relpath(subdir, root))
76-
Log.info('===========================[Shoko Relay Scanner v1.2.10]' + '=' * 244)
76+
Log.info('===========================[Shoko Relay Scanner v1.2.11]' + '=' * 244)
7777

7878
if files:
7979
# Scan for video files

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![Shoko Relay Logo](https://github.com/natyusha/ShokoRelay.bundle/assets/985941/23bfd7c2-eb89-46d5-a7cb-558c374393d6 "Shoko Relay")
22
=======================
3-
This is a bundle containing a Plex metadata agent, scanner, and automation scripts written to work with anything listed on AniDB. All you need to get started is a populated [Shoko Server](https://shokoanime.com/) (v4.2.2.161+) and [Plex Media Server](https://www.plex.tv/media-server-downloads/) (Not running on an Nvidia Shield). Unlike the original metadata bundle for Shoko this one does not include a movie scanner and is intended to work with series of all types within a single "TV Shows" library.
3+
This is a bundle containing a Plex metadata agent, scanner, and automation scripts written to work with anything listed on AniDB. All you need to get started is a populated [Shoko Server](https://shokoanime.com/) (v4.2.2.176+) and [Plex Media Server](https://www.plex.tv/media-server-downloads/) (Not running on an Nvidia Shield). Unlike the original metadata bundle for Shoko this one does not include a movie scanner and is intended to work with series of all types within a single "TV Shows" library.
44

55
## Installation
66
- Extract [the latest release](https://github.com/natyusha/ShokoRelay.bundle/releases/latest/download/ShokoRelay.bundle.zip) into your [Plex Media Server Plug-ins Folder](https://support.plex.tv/articles/201106098-how-do-i-find-the-plug-ins-folder/) `\Plex Media Server\Plug-ins`

0 commit comments

Comments
 (0)