Minor cleanups

Improved text for popular result
This commit is contained in:
lomion 2022-12-22 22:38:56 +01:00 committed by Scott Wallace
parent 0f3cb6b3d3
commit 78eedc51de
Signed by: scott
GPG key ID: AA742FDC5AFE2A72
2 changed files with 5 additions and 5 deletions

View file

@ -34,7 +34,7 @@ class TestTmdbMethods(unittest.IsolatedAsyncioTestCase):
await movie.load_parameters() await movie.load_parameters()
await movie.search_title('Dune') await movie.search_title('Dune')
vote = movie.vote_average vote = movie.vote_average
self.assertEqual(vote, 7.845) self.assertEqual(vote, 7.828)
await movie.close_session() await movie.close_session()
async def test_cast(self): async def test_cast(self):

View file

@ -73,8 +73,7 @@ class TmdbBot(Plugin):
content = TextMessageEventContent( content = TextMessageEventContent(
msgtype=MessageType.NOTICE, format=Format.HTML, msgtype=MessageType.NOTICE, format=Format.HTML,
body=message) body=message)
event_id = await evt.respond(content) await evt.respond(content)
self.db.set_message(event_id, '{ 1:"Notice"}')
async def send_help(self, evt: MessageEvent) -> None: async def send_help(self, evt: MessageEvent) -> None:
html = """<p>Use <b>!tmdb movie {title} [y:{release year}]</b> to get movie detail based on the given title.</p> html = """<p>Use <b>!tmdb movie {title} [y:{release year}]</b> to get movie detail based on the given title.</p>
@ -171,7 +170,9 @@ class TmdbBot(Plugin):
await self.send_movie_info(evt, movie) await self.send_movie_info(evt, movie)
else: else:
text = popular.getListText(length) text = popular.getListText(length)
html = popular.getListHtml(length) html = '<p><b>Currently most popular at <a href="https://www.themoviedb.org">www.themoviedb.org</a>:</b></p>'
html += popular.getListHtml(length)
html += '<p>For details reply to this message with the ranking number from this list</p>'
results = popular.getDict(length) results = popular.getDict(length)
await self.send_html_message(evt, text, html, results) await self.send_html_message(evt, text, html, results)
@ -289,7 +290,6 @@ class TmdbBot(Plugin):
await self.init_movie() await self.init_movie()
await self.api.search_id(populars[str(requ)]) await self.api.search_id(populars[str(requ)])
await self.send_movie_info(evt, self.api) await self.send_movie_info(evt, self.api)
#await self.movie_popular(evt, evt.content.body)
else: else:
self.log.info(f"Not in reply to a known message") self.log.info(f"Not in reply to a known message")
else: else: