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
|
medium = 2
|
||||||
large = 3
|
large = 3
|
||||||
extralarge = 4
|
extralarge = 4
|
||||||
|
mega = 5
|
||||||
|
other = 6
|
||||||
|
|
||||||
def __init__(self, size: Size, link: str):
|
def __init__(self, size: Size, link: str):
|
||||||
self.size = size
|
self.size = size
|
||||||
|
@ -310,7 +310,10 @@ class Network:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_image(image_dict) -> Image:
|
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
|
@staticmethod
|
||||||
def parse_scrobble(scrobble_dict) -> Scrobble:
|
def parse_scrobble(scrobble_dict) -> Scrobble:
|
||||||
|
Loading…
Reference in New Issue
Block a user