From dfa56a79d20a8b6151e1383a8e9888857959d100 Mon Sep 17 00:00:00 2001 From: Michael Herger Date: Mon, 31 Jan 2022 22:38:09 +0100 Subject: [PATCH] #704 Try to get rid of duplicate tracks if only the case of the file name changes. URL comparisons on the tracks table are case insensitive. Therefore we must make those checks against `scanned_files` case insensitive, too. Otherwise files renamed from ABC.mp3 to abc.mp3 would be discovered as new instead of modified only. I change a schema file without adding a new one, as I don't want everybody to have to fully rescan the library for this corner case. Users who care about the change can always delete the library.db to start over from scratch and get the latest schema. --- SQL/SQLite/schema_11_up.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SQL/SQLite/schema_11_up.sql b/SQL/SQLite/schema_11_up.sql index bb311162ef3..ca28b59aaa9 100644 --- a/SQL/SQLite/schema_11_up.sql +++ b/SQL/SQLite/schema_11_up.sql @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS scanned_files; CREATE TABLE scanned_files ( - url text NOT NULL, + url text NOT NULL COLLATE NOCASE, -- URL must be case insensitive, or we might duplicate tracks if the filename changes case only (https://github.com/Logitech/slimserver/issues/705#issuecomment-1026229542) timestamp int(10), filesize int(10) );