Changed release to 0.1.0
Some flake8 improvements
This commit is contained in:
parent
c698cafa02
commit
2c5d3607f3
|
@ -1,6 +1,6 @@
|
|||
maubot: 0.1.0
|
||||
id: lomion.tmdb
|
||||
version: 0.0.3
|
||||
version: 0.1.0
|
||||
license: AGPL 3.0
|
||||
modules:
|
||||
- tmdb
|
||||
|
|
12
tmdb/tmdb.py
12
tmdb/tmdb.py
|
@ -15,17 +15,18 @@ along with tmdb-bot. If not, see <https://www.gnu.org/licenses/>.
|
|||
'''
|
||||
from html import escape
|
||||
|
||||
from mautrix.types import TextMessageEventContent, MediaMessageEventContent, MessageType, Format, RelatesTo, RelationType
|
||||
from mautrix.types import TextMessageEventContent, MediaMessageEventContent, MessageType, Format
|
||||
|
||||
from maubot import Plugin, MessageEvent
|
||||
from maubot.handlers import command
|
||||
|
||||
from tmdb.tmdb_api import Movie
|
||||
|
||||
from sqlalchemy import (Column, String, Integer, ForeignKey, Table, MetaData,
|
||||
select, and_)
|
||||
from sqlalchemy import (Column, String, Integer, Table, MetaData,
|
||||
select)
|
||||
from sqlalchemy.engine.base import Engine
|
||||
|
||||
|
||||
class Database:
|
||||
db: Engine
|
||||
|
||||
|
@ -51,6 +52,7 @@ class Database:
|
|||
.where(self.language.c.user_id == user_id))
|
||||
return rows.fetchone()
|
||||
|
||||
|
||||
class TmdbBot(Plugin):
|
||||
db: Database
|
||||
|
||||
|
@ -67,7 +69,7 @@ class TmdbBot(Plugin):
|
|||
three_dotts = ""
|
||||
cast = "Acting: "
|
||||
for actor in movie.cast[:3]:
|
||||
cast+= f'{actor}, '
|
||||
cast += f'{actor}, '
|
||||
cast = cast[:-2]
|
||||
html_message = f"""<p><b>{escape(movie.title)}</b></p>
|
||||
<p>{escape(movie.overview)[:200]}{three_dotts}</p>
|
||||
|
@ -84,7 +86,6 @@ class TmdbBot(Plugin):
|
|||
url=f"{mxc_uri}")
|
||||
await evt.respond(content)
|
||||
|
||||
|
||||
@command.new("movie-id", help="Movie lookup by id")
|
||||
@command.argument("message", pass_raw=True, required=True)
|
||||
async def movie_id(self, evt: MessageEvent, message: str = "") -> None:
|
||||
|
@ -95,7 +96,6 @@ class TmdbBot(Plugin):
|
|||
movie.query_details(message)
|
||||
await self.send_movie_info(evt, movie)
|
||||
|
||||
|
||||
@command.new("movie-search", help="Movie lookup by Title")
|
||||
@command.argument("message", pass_raw=True, required=True)
|
||||
async def movie_search(self, evt: MessageEvent, message: str = "") -> None:
|
||||
|
|
Loading…
Reference in a new issue