generated from nhcarrigan/template
fix: correct prop for music
This commit is contained in:
@@ -43,20 +43,20 @@ export class MusicService {
|
||||
}
|
||||
|
||||
// Validate cover art URL
|
||||
if (data.coverImage) {
|
||||
if (data.coverImage.startsWith("data:")) {
|
||||
const sizeInBytes = data.coverImage.length * 0.75;
|
||||
if (data.coverArt) {
|
||||
if (data.coverArt.startsWith("data:")) {
|
||||
const sizeInBytes = data.coverArt.length * 0.75;
|
||||
if (sizeInBytes > MAX_LENGTHS.DATA_URL) {
|
||||
throw new Error("Cover image must be under 5MB.");
|
||||
}
|
||||
if (!validateDataUrl(data.coverImage)) {
|
||||
if (!validateDataUrl(data.coverArt)) {
|
||||
throw new Error("Invalid image data URL.");
|
||||
}
|
||||
} else {
|
||||
if (!validateStringLength(data.coverImage, MAX_LENGTHS.URL)) {
|
||||
if (!validateStringLength(data.coverArt, MAX_LENGTHS.URL)) {
|
||||
throw new Error(`Cover image URL must be ${MAX_LENGTHS.URL} characters or less.`);
|
||||
}
|
||||
if (!validateUrl(data.coverImage)) {
|
||||
if (!validateUrl(data.coverArt)) {
|
||||
throw new Error("Invalid cover image URL. Only http and https URLs are allowed.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user