mirror of
https://github.com/pkkid/python-plexapi
synced 2025-02-16 21:08:27 +00:00
Fix broken utils.searchType()
This commit is contained in:
parent
78d8e3b0d9
commit
c75db1df10
1 changed files with 5 additions and 6 deletions
|
@ -253,13 +253,12 @@ def rget(obj, attrstr, default=None, delim='.'):
|
|||
|
||||
|
||||
def searchType(libtype):
|
||||
SEARCHTYPESSTRS = [str(k) for k in SEARCHTYPES.keys()]
|
||||
if libtype in SEARCHTYPES + SEARCHTYPESSTRS:
|
||||
libtype = str(libtype)
|
||||
if libtype in [str(v) for v in SEARCHTYPES.values()]:
|
||||
return libtype
|
||||
stype = SEARCHTYPES.get(libtype.lower())
|
||||
if not stype:
|
||||
raise NotFound('Unknown libtype: %s' % libtype)
|
||||
return stype
|
||||
if SEARCHTYPES.get(libtype) is not None:
|
||||
return SEARCHTYPES[libtype]
|
||||
raise NotFound('Unknown libtype: %s' % libtype)
|
||||
|
||||
|
||||
def threaded(callback, listargs):
|
||||
|
|
Loading…
Add table
Reference in a new issue