fixed updated OVM api
This commit is contained in:
@@ -18,10 +18,22 @@ def getAuctionlocations(countrycode: Countrycode):
|
||||
if(res):
|
||||
return res
|
||||
|
||||
twkauctions = getTwkAuctions(countrycode)
|
||||
|
||||
ovmauctions = getOVMAuctions()
|
||||
twkauctions = []
|
||||
ovmauctions = []
|
||||
|
||||
try:
|
||||
twkauctions = getTwkAuctions(countrycode)
|
||||
except Exception as e:
|
||||
log('something went wrong while running the twk auctions request')
|
||||
print_exc(e)
|
||||
|
||||
try:
|
||||
ovmauctions = getOVMAuctions()
|
||||
except Exception as e:
|
||||
log('something went wrong while running the OVM auctions request')
|
||||
print_exc(e)
|
||||
|
||||
|
||||
auctions = [*twkauctions, *ovmauctions]
|
||||
|
||||
for auction in auctions:
|
||||
@@ -152,8 +164,8 @@ def getOVMAuctions():
|
||||
cityname = "Nederland" if cityname is None else cityname #there can be auctions where you have to make an appointment to retrieve the lots
|
||||
startdatetime = result['openingsDatumISO'].replace("T", " ").replace("Z", "")
|
||||
enddatetime = result['sluitingsDatumISO'].replace("T", " ").replace("Z", "")
|
||||
image = "" if result['image'] else image
|
||||
a = Auction(Auctionbrand.OVM, cityname,result['land'], result['naam'],startdatetime, enddatetime, str(result['land']).lower() + '/veilingen/' + str(result['id']) + '/kavels', 'images/150x150/' + str(result['id']) + '/' + image, result['totaalKavels'] )
|
||||
image = "" if result['imageList'][0] else image
|
||||
a = Auction(Auctionbrand.OVM, cityname,result['land'], result['naam'],startdatetime, enddatetime, str(result['land']).lower() + '/veilingen/' + str(result['id']) + '/kavels', 'images/150x150/' + image, result['totaalKavels'] )
|
||||
auctions.append(a)
|
||||
Cache.add(cachename, auctions)
|
||||
return auctions
|
||||
|
||||
Reference in New Issue
Block a user