Detect currency when sending shared items via c2s

main
Bob Mottram 2021-08-07 18:25:07 +01:00
parent 8cb31a10a8
commit 3fe41d6c85
1 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,7 @@ from utils import isfloat
from media import processMetaData
from filters import isFilteredGlobally
from siteactive import siteIsActive
from content import getPriceFromString
def _dfcProductTypes() -> []:
@ -509,6 +510,14 @@ def sendShareViaServer(baseDir, session,
print('WARN: No session for sendShareViaServer')
return 6
# convert $4.23 to 4.23 USD
newItemPrice, newItemCurrency = getPriceFromString(itemPrice)
if newItemPrice != itemPrice:
itemPrice = newItemPrice
if not itemCurrency:
if newItemCurrency != itemCurrency:
itemCurrency = newItemCurrency
fromDomainFull = getFullDomain(fromDomain, fromPort)
toUrl = 'https://www.w3.org/ns/activitystreams#Public'