Optional location

main
Bob Mottram 2021-07-27 20:23:55 +01:00
parent 82f51299b7
commit f9012cd948
2 changed files with 9 additions and 6 deletions

View File

@ -108,8 +108,9 @@ def _matchSharedItem(searchStrLowerList: [],
""" """
for searchSubstr in searchStrLowerList: for searchSubstr in searchStrLowerList:
searchSubstr = searchSubstr.strip() searchSubstr = searchSubstr.strip()
if searchSubstr in sharedItem['location'].lower(): if sharedItem.get('location'):
return True if searchSubstr in sharedItem['location'].lower():
return True
elif searchSubstr in sharedItem['summary'].lower(): elif searchSubstr in sharedItem['summary'].lower():
return True return True
elif searchSubstr in sharedItem['displayName'].lower(): elif searchSubstr in sharedItem['displayName'].lower():
@ -143,8 +144,9 @@ def _htmlSearchResultShare(sharedItem: {}, translate: {},
'<b>' + translate['Type'] + ':</b> ' + sharedItem['itemType'] + ' ' '<b>' + translate['Type'] + ':</b> ' + sharedItem['itemType'] + ' '
sharedItemsForm += \ sharedItemsForm += \
'<b>' + translate['Category'] + ':</b> ' + sharedItem['category'] + ' ' '<b>' + translate['Category'] + ':</b> ' + sharedItem['category'] + ' '
sharedItemsForm += \ if sharedItem.get('location'):
'<b>' + translate['Location'] + ':</b> ' + sharedItem['location'] sharedItemsForm += \
'<b>' + translate['Location'] + ':</b> ' + sharedItem['location']
if sharedItem.get('itemPrice') and \ if sharedItem.get('itemPrice') and \
sharedItem.get('itemCurrency'): sharedItem.get('itemCurrency'):
if isfloat(sharedItem['itemPrice']): if isfloat(sharedItem['itemPrice']):

View File

@ -833,8 +833,9 @@ def htmlIndividualShare(actor: str, item: {}, translate: {},
'<b>' + translate['Type'] + ':</b> ' + item['itemType'] + ' ' '<b>' + translate['Type'] + ':</b> ' + item['itemType'] + ' '
profileStr += \ profileStr += \
'<b>' + translate['Category'] + ':</b> ' + item['category'] + ' ' '<b>' + translate['Category'] + ':</b> ' + item['category'] + ' '
profileStr += \ if item.get('location'):
'<b>' + translate['Location'] + ':</b> ' + item['location'] profileStr += \
'<b>' + translate['Location'] + ':</b> ' + item['location']
if item.get('itemPrice') and item.get('itemCurrency'): if item.get('itemPrice') and item.get('itemCurrency'):
if isfloat(item['itemPrice']): if isfloat(item['itemPrice']):
if float(item['itemPrice']) > 0: if float(item['itemPrice']) > 0: