Hide future-dated releases in artist profile latest releases

This commit is contained in:
AudioCore Bot
2026-03-05 14:30:52 +00:00
parent c5302c3b44
commit fd03d276f1

View File

@@ -71,11 +71,13 @@ class ArtistsController
SELECT id, title, slug, release_date, cover_url, artist_name SELECT id, title, slug, release_date, cover_url, artist_name
FROM ac_releases FROM ac_releases
WHERE is_published = 1 WHERE is_published = 1
AND (release_date IS NULL OR release_date <= :today)
AND (artist_id = :artist_id OR artist_name = :artist_name) AND (artist_id = :artist_id OR artist_name = :artist_name)
ORDER BY release_date DESC, created_at DESC ORDER BY release_date DESC, created_at DESC
LIMIT 2 LIMIT 2
"); ");
$relStmt->execute([ $relStmt->execute([
':today' => date('Y-m-d'),
':artist_id' => (int)($artist['id'] ?? 0), ':artist_id' => (int)($artist['id'] ?? 0),
':artist_name' => (string)($artist['name'] ?? ''), ':artist_name' => (string)($artist['name'] ?? ''),
]); ]);
@@ -84,11 +86,13 @@ class ArtistsController
SELECT id, title, slug, release_date, cover_url, artist_name SELECT id, title, slug, release_date, cover_url, artist_name
FROM ac_releases FROM ac_releases
WHERE is_published = 1 WHERE is_published = 1
AND (release_date IS NULL OR release_date <= :today)
AND artist_name = :artist_name AND artist_name = :artist_name
ORDER BY release_date DESC, created_at DESC ORDER BY release_date DESC, created_at DESC
LIMIT 2 LIMIT 2
"); ");
$relStmt->execute([ $relStmt->execute([
':today' => date('Y-m-d'),
':artist_name' => (string)($artist['name'] ?? ''), ':artist_name' => (string)($artist['name'] ?? ''),
]); ]);
} }