Add batch string to returned card data

This commit is contained in:
Henry 2020-10-23 19:51:53 +01:00
parent 2462d6768a
commit 9064590ad7

View file

@ -51,11 +51,15 @@ class Card:
self.tier = kwargs.get("tier")
self.claim_count = kwargs.get("claim_count")
extra = kwargs.get("category")
try:
self.anime = extra[0]
except IndexError:
self.anime = None
self.batch = None
try:
extra = kwargs.get("category")
self.anime = extra[0]
self.batch = extra[3]
except IndexError:
pass
self.filename = kwargs.get("file")
self.url = f"{self.IMAGE_CDN}/{self.tier}/{self.filename}"
@ -68,4 +72,5 @@ class Card:
"anime": self.anime,
"link": self.url,
"claim_count": self.claim_count,
"batch": self.batch,
}