File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,14 @@ def __attrs_post_init__(self):
102
102
@classmethod
103
103
def from_element (cls , element : ElementTree .Element ) -> "CardImage" :
104
104
card_dict = unpack_element (element , [x .value for x in constants .DetailsTags ])
105
- drive_id = card_dict [constants .CardTags .id ].text
105
+ drive_id = card_dict [constants .CardTags .id ].text . strip ( ' "' )
106
106
slots = text_to_list (card_dict [constants .CardTags .slots ].text )
107
- name = card_dict [constants .CardTags .name ].text
108
- query = card_dict [constants .CardTags .query ].text
107
+ name = None
108
+ if constants .CardTags .name in card_dict .keys ():
109
+ name = card_dict [constants .CardTags .name ].text
110
+ query = None
111
+ if constants .CardTags .name in card_dict .keys ():
112
+ query = card_dict [constants .CardTags .query ].text
109
113
card_image = cls (drive_id = drive_id , slots = slots , name = name , query = query )
110
114
return card_image
111
115
@@ -180,7 +184,7 @@ def from_element(
180
184
if missing_slots :
181
185
card_image_collection .cards .append (
182
186
CardImage (
183
- drive_id = fill_image_id ,
187
+ drive_id = fill_image_id . strip ( ' "' ) ,
184
188
slots = list (missing_slots ),
185
189
)
186
190
)
You can’t perform that action at this time.
0 commit comments