added wider scope playlist counting and handling for unknown image sizes
This commit is contained in:
parent
c2561ae9de
commit
3289e6b242
@ -15,6 +15,8 @@ class Image:
|
||||
medium = 2
|
||||
large = 3
|
||||
extralarge = 4
|
||||
mega = 5
|
||||
other = 6
|
||||
|
||||
def __init__(self, size: Size, link: str):
|
||||
self.size = size
|
||||
|
@ -310,7 +310,10 @@ class Network:
|
||||
|
||||
@staticmethod
|
||||
def parse_image(image_dict) -> Image:
|
||||
return Image(size=Image.Size[image_dict['size']], link=image_dict['#text'])
|
||||
try:
|
||||
return Image(size=Image.Size[image_dict['size']], link=image_dict['#text'])
|
||||
except KeyError:
|
||||
return Image(size=Image.Size['other'], link=image_dict['#text'])
|
||||
|
||||
@staticmethod
|
||||
def parse_scrobble(scrobble_dict) -> Scrobble:
|
||||
|
Loading…
Reference in New Issue
Block a user