From: Damyan Ivanov Date: Thu, 11 Nov 2021 12:35:37 +0000 (+0000) Subject: rename unwanted artist/album tables X-Git-Url: https://git.ktnx.net/?p=mpd-feeder.git;a=commitdiff_plain;h=744b004c547dab563ead08fa0da87dabf6e537e9 rename unwanted artist/album tables --- diff --git a/bin/mpd-feeder b/bin/mpd-feeder index 9397654..be0fc2c 100755 --- a/bin/mpd-feeder +++ b/bin/mpd-feeder @@ -293,8 +293,8 @@ JOIN albums al ON al.album=s.album WHERE (s.last_queued IS NULL OR s.last_queued < CURRENT_TIMESTAMP - (? || ' seconds')::interval) AND (ar.last_queued IS NULL OR ar.last_queued < CURRENT_TIMESTAMP - (? || ' seconds')::interval) AND (al.last_queued IS NULL OR al.last_queued < CURRENT_TIMESTAMP - (? || ' seconds')::interval) - AND NOT EXISTS (SELECT 1 FROM blacklisted_artists bar WHERE bar.artist = s.artist) - AND NOT EXISTS (SELECT 1 FROM blacklisted_albums bal WHERE bal.album = s.album) + AND NOT EXISTS (SELECT 1 FROM unwanted_artists uar WHERE uar.artist = s.artist) + AND NOT EXISTS (SELECT 1 FROM unwanted_albums ual WHERE ual.album = s.album) ORDER BY random() LIMIT ? SQL diff --git a/sql/pgsql/init.sql b/sql/pgsql/init.sql index 74598fd..8cdce3d 100644 --- a/sql/pgsql/init.sql +++ b/sql/pgsql/init.sql @@ -22,13 +22,13 @@ create table artists( last_queued timestamp with time zone, generation bigint not null); -create table blacklisted_albums( +create table unwanted_albums( artist text not null, album text not null, generation bigint not null, primary key(album,artist)); -create table blacklisted_artists( +create table unwanted_artists( artist text not null primary key, generation bigint not null );