From 449585803e90b0b074c08c49e97281c5427c27cc Mon Sep 17 00:00:00 2001 From: halali Date: Tue, 28 Aug 2018 19:19:20 +0200 Subject: [PATCH] Improve series notification message (#131) * Improve series notification message * Forgot delete Print * Simplify code --- notifier.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notifier.py b/notifier.py index 6e9bcf5ec..6109e1fa7 100644 --- a/notifier.py +++ b/notifier.py @@ -23,10 +23,10 @@ def get_series_name(sonarrSeriesId): def get_episode_name(sonarrEpisodeId): conn_db = sqlite3.connect(os.path.join(config_dir, 'db/bazarr.db'), timeout=30) c_db = conn_db.cursor() - data = c_db.execute('SELECT title FROM table_episodes WHERE sonarrEpisodeId = ?', (sonarrEpisodeId,)).fetchone() + data = c_db.execute('SELECT title, season, episode FROM table_episodes WHERE sonarrEpisodeId = ?', (sonarrEpisodeId,)).fetchone() c_db.close() - return data[0] + return data[0], data[1], data[2] def get_movies_name(radarrId): conn_db = sqlite3.connect(os.path.join(config_dir, 'db/bazarr.db'), timeout=30) @@ -49,7 +49,7 @@ def send_notifications(sonarrSeriesId, sonarrEpisodeId, message): apobj.notify( title='Bazarr notification', - body=series + ' - ' + episode + ' : ' + message, + body=(series + ' - S' + str(episode[1]).zfill(2) + 'E' + str(episode[2]).zfill(2) + ' - ' + episode[0] + ' : ' + message), )