From 94baaf929673d71bcc1c5c489d70d4e7272e3d88 Mon Sep 17 00:00:00 2001 From: lomion Date: Tue, 29 Sep 2020 09:49:16 +0200 Subject: [PATCH 1/2] Fixed handling of poster size and language if user did not set these values --- maubot.yaml | 2 +- tmdb/database.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/maubot.yaml b/maubot.yaml index e9b225a..75332d5 100644 --- a/maubot.yaml +++ b/maubot.yaml @@ -1,6 +1,6 @@ maubot: 0.1.0 id: lomion.tmdb -version: 1.0.0 +version: 1.0.1 license: AGPL 3.0 modules: - tmdb diff --git a/tmdb/database.py b/tmdb/database.py index 4dfd103..9e2cf3b 100644 --- a/tmdb/database.py +++ b/tmdb/database.py @@ -45,7 +45,11 @@ class Database: def get_language(self, user_id): rows = self.db.execute(select([self.language.c.language]) .where(self.language.c.user_id == user_id)) - return rows.fetchone()['language'] + row = rows.fetchone() + if row: + return row['language'] + else: + return None def set_poster_size(self, user_id, size): with self.db.begin() as tx: @@ -55,4 +59,8 @@ class Database: def get_poster_size(self, user_id): rows = self.db.execute(select([self.tmdb_poster_size.c.size]) .where(self.tmdb_poster_size.c.user_id == user_id)) - return rows.fetchone()['size'] \ No newline at end of file + row = rows.fetchone() + if row: + return row['size'] + else: + return None \ No newline at end of file From 17dbdaae1228662b426511aca27c27518c977e4d Mon Sep 17 00:00:00 2001 From: lomion Date: Sat, 16 Jan 2021 09:02:44 +0100 Subject: [PATCH 2/2] Added script to create release --- create_release.sh | 1 + 1 file changed, 1 insertion(+) create mode 100755 create_release.sh diff --git a/create_release.sh b/create_release.sh new file mode 100755 index 0000000..039cee7 --- /dev/null +++ b/create_release.sh @@ -0,0 +1 @@ +zip -r lomion.tmdb.mbp maubot.yaml tmdb/__init__.py tmdb/tmdb.py tmdb/tmdb_api.py tmdb/database.py