Skip to content

Commit

Permalink
영화: 자동 완성(Auto Match)이 무조건 최상위 검색 결과를 선택하던 문제 수정 (Fixes axfree#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
axfree committed Feb 18, 2019
1 parent 09ea2a4 commit e579e20
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ def searchDaumMovie(results, media, lang):
if len(items) > 0:
for idx, item in enumerate(items):
title, id, poster, year, r = item.split('|')
score = 80 - idx * 20
if media_name in title:
score = 80 - min(15, len(title) - len(media_name)) * 5
else:
score = 80 - min(5, idx) * 15
if media.year:
score += (2 - min(2, abs(int(media.year) - int(year)))) * 5
if score < 10:
score = 10
Log.Debug('ID=%s, media_name=%s, title=%s, year=%s, score=%d' % (id, media_name, title, year, score))
results.Append(MetadataSearchResult(id=id, name=title, year=year, score=score, lang=lang))
break
Expand Down

0 comments on commit e579e20

Please sign in to comment.