From 78eedc51def5fa36a5115560ca539f22c4b50d60 Mon Sep 17 00:00:00 2001 From: lomion Date: Thu, 22 Dec 2022 22:38:56 +0100 Subject: [PATCH] Minor cleanups Improved text for popular result --- test_tmdb.py | 2 +- tmdb/tmdb.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test_tmdb.py b/test_tmdb.py index 886e060..8324b0f 100644 --- a/test_tmdb.py +++ b/test_tmdb.py @@ -34,7 +34,7 @@ class TestTmdbMethods(unittest.IsolatedAsyncioTestCase): await movie.load_parameters() await movie.search_title('Dune') vote = movie.vote_average - self.assertEqual(vote, 7.845) + self.assertEqual(vote, 7.828) await movie.close_session() async def test_cast(self): diff --git a/tmdb/tmdb.py b/tmdb/tmdb.py index 6010533..62a0a02 100644 --- a/tmdb/tmdb.py +++ b/tmdb/tmdb.py @@ -73,8 +73,7 @@ class TmdbBot(Plugin): content = TextMessageEventContent( msgtype=MessageType.NOTICE, format=Format.HTML, body=message) - event_id = await evt.respond(content) - self.db.set_message(event_id, '{ 1:"Notice"}') + await evt.respond(content) async def send_help(self, evt: MessageEvent) -> None: html = """

Use !tmdb movie {title} [y:{release year}] to get movie detail based on the given title.

@@ -171,7 +170,9 @@ class TmdbBot(Plugin): await self.send_movie_info(evt, movie) else: text = popular.getListText(length) - html = popular.getListHtml(length) + html = '

Currently most popular at www.themoviedb.org:

' + html += popular.getListHtml(length) + html += '

For details reply to this message with the ranking number from this list

' results = popular.getDict(length) await self.send_html_message(evt, text, html, results) @@ -289,7 +290,6 @@ class TmdbBot(Plugin): await self.init_movie() await self.api.search_id(populars[str(requ)]) await self.send_movie_info(evt, self.api) - #await self.movie_popular(evt, evt.content.body) else: self.log.info(f"Not in reply to a known message") else: