Closed paul20230815 closed 1 year ago
Stumbled over this issue after updating plugin.video.netflix from 1.20.3 to 1.20.5 on an Ubuntu 18.04+Kodi Matrix 19.5 install, which has SQLite3 v3.22.
Reverting https://github.com/CastagnaIT/plugin.video.netflix/commit/2ac70df96aea1119743937a1ed07afb6de9f4698 "fixes" this.
please try replace the method code with this and let me know
@handle_connection
def set_value(self, key, value, table=db_utils.TABLE_APP_CONF):
"""
Store a single value to database
:param key: The key to store the value
:param value: Value to save
:param table: Table map
"""
table_name = table[0]
table_columns = table[1]
value = common.convert_to_string(value)
# Update or insert approach, if there is no updated row then insert new one (no id changes)
if common.CmpVersion(sql.sqlite_version) < '3.24.0':
query = f'INSERT OR REPLACE INTO {table_name} ({table_columns[0]}, {table_columns[1]}) VALUES (?, ?)'
self._execute_non_query(query, (key, value))
else:
# sqlite UPSERT clause exists only on sqlite >= 3.24.0
query = (f'INSERT INTO {table_name} ({table_columns[0]}, {table_columns[1]}) VALUES (?, ?) '
f'ON CONFLICT({table_columns[0]}) DO UPDATE SET {table_columns[1]} = ? '
f'WHERE {table_columns[0]} = ?')
self._execute_non_query(query, (key, value, value, key))
seem that dont like have arguments to not be used
Just tried with your replacement set_value(), which results in this diff:
--- a/resources/lib/database/db_base_sqlite.py
+++ b/resources/lib/database/db_base_sqlite.py
@@ -214,16 +214,17 @@ class SQLiteDatabase(db_base.BaseDatabase):
"""
table_name = table[0]
table_columns = table[1]
+ value = common.convert_to_string(value)
# Update or insert approach, if there is no updated row then insert new one (no id changes)
if common.CmpVersion(sql.sqlite_version) < '3.24.0':
query = f'INSERT OR REPLACE INTO {table_name} ({table_columns[0]}, {table_columns[1]}) VALUES (?, ?)'
+ self._execute_non_query(query, (key, value))
else:
# sqlite UPSERT clause exists only on sqlite >= 3.24.0
query = (f'INSERT INTO {table_name} ({table_columns[0]}, {table_columns[1]}) VALUES (?, ?) '
f'ON CONFLICT({table_columns[0]}) DO UPDATE SET {table_columns[1]} = ? '
f'WHERE {table_columns[0]} = ?')
- value = common.convert_to_string(value)
- self._execute_non_query(query, (key, value, value, key))
+ self._execute_non_query(query, (key, value, value, key))
@handle_connection
def set_values(self, dict_values, table=db_utils.TABLE_APP_CONF):
and everything works, ie. with unchanged master, plugin.video.netflix complains that background services are not started and cannot be started when opening the addon, with the diff applied it just starts as expected.
thanks for the feedback i will apply the changes
What can we do to fix the problem?
its already fixed on new release
And with the new version the problem remains. I am using the flatpak version of kodi
@andreasdimo open a new issue by fullfill bug template
Netflix add-on version
v1.20.4+matrix.1
Operative systems used
Linux (Ubuntu / Mint / ...)
Kodi version used
Kodi 19 (Matrix)
Description of the bug
During startup of Kodi or after fresh install of plugin.video.netflix I see the following message in the log:
Same happens for version v1.20.5+matrix.1, version v1.20.3+matrix.1 still works fine. This is probably due to commit 2ac70df96aea1119743937a1ed07afb6de9f4698. I'm using libsqlite3-0:amd64 3.22.0-1ubuntu0.7. A bit debugging showed that params has indeed 4 items (log is gone unfortunately :-( ) I recall "1.20v5, service_previous_version, service_previous_version, 1.20v5" or similar.
Steps to reproduce the behavior
Debug log - mandatory
https://paste.kodi.tv/tawaxivili.kodi
Possible fix
No response
Additional context
No response
Screenshots
No response