From 14c135a6344507b20737ba8a660dba2d2049608a Mon Sep 17 00:00:00 2001 From: croneter Date: Thu, 22 Nov 2018 07:54:54 +0100 Subject: [PATCH] Fix OperationalError: no such column --- resources/lib/kodi_db/music.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/lib/kodi_db/music.py b/resources/lib/kodi_db/music.py index 28f939d5..b965bafa 100644 --- a/resources/lib/kodi_db/music.py +++ b/resources/lib/kodi_db/music.py @@ -473,10 +473,13 @@ class KodiMusicDB(common.KodiDBBase): Updates userrating for songs and albums """ if kodi_type == v.KODI_TYPE_SONG: + column = 'userrating' identifier = 'idSong' elif kodi_type == v.KODI_TYPE_ALBUM: + column = 'iUserrating' identifier = 'idAlbum' - self.cursor.execute('''UPDATE %s SET userrating = ? WHERE ? = ?''' % kodi_type, + self.cursor.execute('''UPDATE %s SET %s = ? WHERE ? = ?''' + % (kodi_type, column), (userrating, identifier, kodi_id)) def remove_albuminfosong(self, kodi_id):