[71] Fix NoneType Error

pull/1237/head
meisnate12 2 years ago
parent a34c4d4760
commit a91fa1e57d

@ -1 +1 @@
1.18.0-develop70
1.18.0-develop71

@ -13,6 +13,8 @@ external_templates:
conditions:
- library_type: show
value: episode
default:
text: Runtime
horizontal_offset: 15
horizontal_align: right
vertical_offset: 30
@ -20,7 +22,7 @@ external_templates:
back_color: "#00000099"
back_width: 600
back_height: 105
final_name: "text(Runtime: <<runtimeH>>h <<runtimeM>>m)"
final_name: "text(<<text>>: <<runtimeH>>h <<runtimeM>>m)"
overlays:
runtime_info:

@ -7,6 +7,29 @@ templates:
font_color: "#FFFFFF"
back_radius: 30
weight_<<key>>: <<weight>>
file_<<key>>: <<file>>
url_<<key>>: <<url>>
git_<<key>>: <<git>>
repo_<<key>>: <<repo>>
pmm_<<key>>: <<pmm>>
font_<<key>>: <<font>>
font_size_<<key>>: <<font_size>>
font_color_<<key>>: <<font_color>>
font_style_<<key>>: <<font_style>>
horizontal_offset_<<key>>: <<horizontal_offset>>
horizontal_align_<<key>>: <<horizontal_align>>
vertical_offset_<<key>>: <<vertical_offset>>
vertical_align_<<key>>: <<vertical_align>>
stroke_width_<<key>>: <<stroke_width>>
stroke_color_<<key>>: <<stroke_color>>
back_color_<<key>>: <<back_color>>
back_width_<<key>>: <<back_width>>
back_height_<<key>>: <<back_height>>
back_align_<<key>>: <<back_align>>
back_radius_<<key>>: <<back_radius>>
back_padding_<<key>>: <<back_padding>>
back_line_color_<<key>>: <<back_line_color>>
back_line_width_<<key>>: <<back_line_width>>
final_name: <<overlay_name>>
optional:
- overlay_level
@ -46,31 +69,31 @@ templates:
suppress_overlays: <<suppress_overlays>>
overlay:
name: <<final_name>>
file: <<file>>
url: <<url>>
git: <<git>>
repo: <<repo>>
pmm: <<pmm>>
file: <<file_<<key>>>>
url: <<url_<<key>>>>
git: <<git_<<key>>>>
repo: <<repo_<<key>>>>
pmm: <<pmm_<<key>>>>
group: <<group>>
queue: <<queue>>
weight: <<weight_<<key>>>>
horizontal_offset: <<horizontal_offset>>
horizontal_align: <<horizontal_align>>
vertical_offset: <<vertical_offset>>
vertical_align: <<vertical_align>>
font: <<font>>
font_style: <<font_style>>
font_size: <<font_size>>
font_color: <<font_color>>
stroke_width: <<stroke_width>>
stroke_color: <<stroke_color>>
back_color: <<back_color>>
back_width: <<back_width>>
back_height: <<back_height>>
back_align: <<back_align>>
back_padding: <<back_padding>>
back_radius: <<back_radius>>
back_line_color: <<back_line_color>>
back_line_width: <<back_line_width>>
horizontal_offset: <<horizontal_offset_<<key>>>>
horizontal_align: <<horizontal_align_<<key>>>>
vertical_offset: <<vertical_offset_<<key>>>>
vertical_align: <<vertical_align_<<key>>>>
font: <<font_<<key>>>>
font_style: <<font_style_<<key>>>>
font_size: <<font_size_<<key>>>>
font_color: <<font_color_<<key>>>>
stroke_width: <<stroke_width_<<key>>>>
stroke_color: <<stroke_color_<<key>>>>
back_color: <<back_color_<<key>>>>
back_width: <<back_width_<<key>>>>
back_height: <<back_height_<<key>>>>
back_align: <<back_align_<<key>>>>
back_padding: <<back_padding_<<key>>>>
back_radius: <<back_radius_<<key>>>>
back_line_color: <<back_line_color_<<key>>>>
back_line_width: <<back_line_width_<<key>>>>
addon_offset: <<addon_offset>>
addon_position: <<addon_position>>

@ -41,6 +41,7 @@ All [Shared Overlay Variables](../overlay_variables) are available with the defa
| Variable | Description & Values |
|:---------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `text` | **Description:** Choose the text for the Overlay.<br>**Default:** `Runtime`<br>**Values:** Any String |
| `font` | **Description:** Choose the font for the Overlay.<br>**Default:** `fonts/Inter-Medium.ttf`<br>**Values:** Path to font file |
| `font_style` | **Description:** Font style for Variable Fonts.<br>**Values:** Variable Font Style |
| `font_size` | **Description:** Choose the font size for the Overlay.<br>**Default:** `55`<br>**Values:** Any Number greater then 0 |

@ -242,6 +242,20 @@ class CollectionBuilder:
else:
self.name = self.mapping_name
if self.playlist:
if "libraries" not in methods:
raise Failed("Playlist Error: libraries attribute is required")
logger.debug("")
logger.debug("Validating Method: libraries")
if not self.data[methods["libraries"]]:
raise Failed(f"{self.Type} Error: libraries attribute is blank")
logger.debug(f"Value: {self.data[methods['libraries']]}")
for pl_library in util.get_list(self.data[methods["libraries"]]):
if str(pl_library) not in config.library_map:
raise Failed(f"Playlist Error: Library: {pl_library} not defined")
self.libraries.append(config.library_map[pl_library])
self.library = self.libraries[0]
try:
self.obj = self.library.get_playlist(self.name) if self.playlist else self.library.get_collection(self.name, force_search=True)
except Failed:
@ -323,19 +337,6 @@ class CollectionBuilder:
self.sync_to_users = None
self.valid_users = []
if self.playlist:
if "libraries" not in methods:
raise Failed("Playlist Error: libraries attribute is required")
logger.debug("")
logger.debug("Validating Method: libraries")
if not self.data[methods["libraries"]]:
raise Failed(f"{self.Type} Error: libraries attribute is blank")
logger.debug(f"Value: {self.data[methods['libraries']]}")
for pl_library in util.get_list(self.data[methods["libraries"]]):
if str(pl_library) not in config.library_map:
raise Failed(f"Playlist Error: Library: {pl_library} not defined")
self.libraries.append(config.library_map[pl_library])
self.library = self.libraries[0]
if "sync_to_users" in methods or "sync_to_user" in methods:
s_attr = f"sync_to_user{'s' if 'sync_to_users' in methods else ''}"
logger.debug("")

Loading…
Cancel
Save