From 1807deed67981681d2cc01686b9ec5204525c4ec Mon Sep 17 00:00:00 2001 From: Brett Spaulding Date: Tue, 13 Aug 2024 09:19:28 -0400 Subject: [PATCH] [FIX] php: Artists or albums cannot have / in name --- php/src/app/Models/Album.php | 2 +- php/src/app/Models/Artist.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/php/src/app/Models/Album.php b/php/src/app/Models/Album.php index 8591325..89dfc62 100644 --- a/php/src/app/Models/Album.php +++ b/php/src/app/Models/Album.php @@ -34,7 +34,7 @@ class Album extends Model public static function addAlbum(string $name, string $thumbnail, string $url_remote, string $image, $artist_id) { $album = new Album(); - $album->name = $name; + $album->name = str_replace('/', '-', $name); $album->artist_id = $artist_id; $album->url_remote = $url_remote; $album->thumbnail = $thumbnail; diff --git a/php/src/app/Models/Artist.php b/php/src/app/Models/Artist.php index 7e0fb81..329f408 100644 --- a/php/src/app/Models/Artist.php +++ b/php/src/app/Models/Artist.php @@ -33,7 +33,7 @@ class Artist extends Model public static function addArtist(string $name, string $thumbnail, string $url_remote, string $image) { $artist = new Artist(); - $artist->name = $name; + $artist->name = str_replace('/', '-', $name); $artist->url_remote = $url_remote; $artist->thumbnail = $thumbnail; $artist->image = $image;