fixed updated OVM api

This commit is contained in:
Computerboer
2024-04-06 16:15:55 +02:00
parent 2fe1b41229
commit 9d2950545c

View File

@@ -18,9 +18,21 @@ def getAuctionlocations(countrycode: Countrycode):
if(res): if(res):
return res return res
twkauctions = getTwkAuctions(countrycode) 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() ovmauctions = getOVMAuctions()
except Exception as e:
log('something went wrong while running the OVM auctions request')
print_exc(e)
auctions = [*twkauctions, *ovmauctions] auctions = [*twkauctions, *ovmauctions]
@@ -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 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", "") startdatetime = result['openingsDatumISO'].replace("T", " ").replace("Z", "")
enddatetime = result['sluitingsDatumISO'].replace("T", " ").replace("Z", "") enddatetime = result['sluitingsDatumISO'].replace("T", " ").replace("Z", "")
image = "" if result['image'] else image 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/' + str(result['id']) + '/' + image, result['totaalKavels'] ) 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) auctions.append(a)
Cache.add(cachename, auctions) Cache.add(cachename, auctions)
return auctions return auctions