mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-25 22:10:22 +00:00
[6] cast limit to int
This commit is contained in:
parent
334e4d8fd2
commit
34779702cb
3 changed files with 11 additions and 5 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.17.3-develop5
|
||||
1.17.3-develop6
|
||||
|
|
|
@ -1762,11 +1762,15 @@ class CollectionBuilder:
|
|||
raise Failed(f"{self.Type} Error: limit attribute is blank")
|
||||
elif str(plex_filter[filter_alias["limit"]]).lower() == "all":
|
||||
filter_details += "Limit: all\n"
|
||||
elif not isinstance(plex_filter[filter_alias["limit"]], int) or plex_filter[filter_alias["limit"]] < 1:
|
||||
raise Failed(f"{self.Type} Error: limit attribute must be an integer greater than 0")
|
||||
else:
|
||||
limit = plex_filter[filter_alias["limit"]]
|
||||
filter_details += f"Limit: {limit}\n"
|
||||
try:
|
||||
if int(plex_filter[filter_alias["limit"]]) < 1:
|
||||
raise ValueError
|
||||
else:
|
||||
limit = int(plex_filter[filter_alias["limit"]])
|
||||
filter_details += f"Limit: {limit}\n"
|
||||
except ValueError:
|
||||
raise Failed(f"{self.Type} Error: limit attribute must be an integer greater than 0")
|
||||
|
||||
validate = True
|
||||
if "validate" in filter_alias:
|
||||
|
|
|
@ -168,6 +168,8 @@ class DataFile:
|
|||
def replace_var(input_item, search_dict):
|
||||
return_item = str(input_item)
|
||||
for rk, rv in search_dict.items():
|
||||
if f"<<{rk}>>" == return_item:
|
||||
return_item = rv
|
||||
if f"<<{rk}>>" in return_item:
|
||||
return_item = return_item.replace(f"<<{rk}>>", str(rv))
|
||||
return return_item
|
||||
|
|
Loading…
Reference in a new issue