Turned movie title into link

This commit is contained in:
lomion 2020-06-24 10:51:42 +02:00
parent 10955cc96f
commit 984ce533e5
2 changed files with 2 additions and 2 deletions

View file

@ -41,7 +41,7 @@ class TestTmdbMethods(unittest.TestCase):
tmdb = TmdbBot("","" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ) tmdb = TmdbBot("","" ,"" ,"" ,"" ,"" ,"" ,"" ,"" )
movie.query_details('550') movie.query_details('550')
message = tmdb.construct_html_message(movie, overview_length = 10) message = tmdb.construct_html_message(movie, overview_length = 10)
self.assertEqual(message, """<p><b>Fight Club</b></p> self.assertEqual(message, """<p><a href="https://www.themoviedb.org/movie/550"><b>Fight Club</b></a></p>
<p>Ein Yuppie [...]</p> <p>Ein Yuppie [...]</p>
<p>Acting: Edward Norton, Brad Pitt, Helena Bonham Carter</p> <p>Acting: Edward Norton, Brad Pitt, Helena Bonham Carter</p>
<p>taken from www.themoviedb.org</p>""") <p>taken from www.themoviedb.org</p>""")

View file

@ -56,7 +56,7 @@ class TmdbBot(Plugin):
for actor in movie.cast[:cast_length]: for actor in movie.cast[:cast_length]:
cast+= f'{actor}, ' cast+= f'{actor}, '
cast = cast[:-2] cast = cast[:-2]
html_message = f"""<p><b>{escape(movie.title)}</b></p> html_message = f"""<p><a href="{movie.web_url}"><b>{escape(movie.title)}</b></a></p>
<p>{escape(movie.overview)[:overview_length]}{three_dotts}</p> <p>{escape(movie.overview)[:overview_length]}{three_dotts}</p>
<p>{cast}</p> <p>{cast}</p>
<p>taken from www.themoviedb.org</p>""" <p>taken from www.themoviedb.org</p>"""