From 5b5c4d1a8b057af4481bc6c56a846abe09712495 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sun, 24 May 2020 00:36:41 -0700 Subject: [PATCH] Ignore reference_id when deleting duplicate rows --- plexpy/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexpy/database.py b/plexpy/database.py index 142aa580..f0db1581 100644 --- a/plexpy/database.py +++ b/plexpy/database.py @@ -154,7 +154,7 @@ def import_tautulli_db(database=None, method=None, backup=False): if method == 'merge': for table_name, columns in sorted(table_columns.items()): - duplicate_columns = ', '.join([c for c in columns if c != 'id']) + duplicate_columns = ', '.join([c for c in columns if c not in ('id', 'reference_id')]) logger.info("Tautulli Database :: Removing duplicate rows from database table '%s'.", table_name) if table_name in session_history_tables[1:]: db.action('DELETE FROM {table} WHERE id NOT IN '