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
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
);