Skip to content

Commit

Permalink
Merge pull request hojel#1 from heegeunyoon/patch-1
Browse files Browse the repository at this point in the history
Update __init__.py
  • Loading branch information
hojel committed Sep 2, 2013
2 parents da8a956 + f75aeb3 commit ca612d9
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,29 @@ def update(self, metadata, media, lang):
metadata.title = info['titleKo']
metadata.original_title = info['titleEn']
metadata.year = int(info['prodYear'])
metadata.rating = float(info['moviePoint']['inspectPointAvg'])

try: metadata.rating = float(info['moviePoint']['inspectPointAvg'])
except: pass

metadata.genres.clear()
for item in info['genres']:
metadata.genres.add(item['genreName'])

try: metadata.duration = int(info['showtime'])*60
except: pass

metadata.summary = String.DecodeHTMLEntities(String.StripTags(info['plot']).strip())
poster_url = info['photo']['fullname']


# countries
metadata.countries.clear()
for item in info['countries']:
metadata.countries.add(item['countryKo'])

# Release Date
try: metadata.originally_available_at = Datetime.ParseDate(info['releaseDate']).date()
except: pass

# (2) cast crew
metadata.directors.clear()
metadata.writers.clear()
Expand Down

0 comments on commit ca612d9

Please sign in to comment.