Fix matching field when validating filter field

This commit is contained in:
JonnyWong16 2021-05-15 23:12:19 -07:00
parent 7146587b0d
commit 814efb1def
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -783,11 +783,11 @@ class LibrarySection(PlexObject):
libtype = _libtype or libtype or self.TYPE
try:
filterField = next(f for f in self.listFields(libtype) if f.key.endswith(field))
filterField = next(f for f in self.listFields(libtype) if f.key.split('.')[-1] == field)
except StopIteration:
for filterType in reversed(self.filterTypes()):
if filterType.type != libtype:
filterField = next((f for f in filterType.fields if f.key.endswith(field)), None)
filterField = next((f for f in filterType.fields if f.key.split('.')[-1] == field), None)
if filterField:
break
else: