only last gross / budget, not sum

This commit is contained in:
j 2008-09-30 18:05:19 +02:00
parent ce0d5692c7
commit 1145a42e5c

View file

@ -408,11 +408,13 @@ def getMovieBusinessSum(imdbId):
business = getMovieBusiness(imdbId)
b_ = {'budget': 0, 'gross': 0, 'profit': 0}
if 'budget' in business:
b_['budget'] = sum([int(intValue(i.replace(',', ''))) for i in business['budget']])
#b_['budget'] = sum([int(intValue(i.replace(',', ''))) for i in business['budget']])
b_['budget'] = int(intValue(business['budget'][0].replace(',', '')))
if 'gross' in business:
b_['gross'] = sum([int(intValue(i.replace(',', ''))) for i in business['gross']])
if 'weekend gross' in business:
b_['gross'] += sum([int(intValue(i.replace(',', ''))) for i in business['weekend gross']])
b_['gross'] = int(intValue(business['gross'][0].replace(',', '')))
#b_['gross'] = sum([int(intValue(i.replace(',', ''))) for i in business['gross']])
#if 'weekend gross' in business:
# b_['gross'] += sum([int(intValue(i.replace(',', ''))) for i in business['weekend gross']])
if b_['budget'] and b_['gross']:
b_['profit'] = b_['gross'] - b_['budget']
return b_