mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 17:38:31 +00:00
waiter! waiter! more optional chainers please!
This commit is contained in:
parent
55bcc66cda
commit
845bad8a7e
@ -113,17 +113,16 @@ export default async function(obj) {
|
|||||||
|
|
||||||
if (!file) return { error: "fetch.empty" };
|
if (!file) return { error: "fetch.empty" };
|
||||||
|
|
||||||
const title = json.title.trim();
|
|
||||||
const artist = json.user.username.trim();
|
const artist = json.user.username.trim();
|
||||||
const fileMetadata = {
|
const fileMetadata = {
|
||||||
title,
|
title: json.title.trim(),
|
||||||
album: json.publisher_metadata.album_title?.trim() ?? title,
|
album: json.publisher_metadata?.album_title?.trim(),
|
||||||
artist,
|
artist,
|
||||||
album_artist: artist,
|
album_artist: artist,
|
||||||
composer: json.publisher_metadata.writer_composer?.trim(),
|
composer: json.publisher_metadata?.writer_composer?.trim(),
|
||||||
genre: json.genre.trim(),
|
genre: json.genre?.trim(),
|
||||||
date: json.display_date.slice(0, 4),
|
date: json.display_date?.trim().slice(0, 10),
|
||||||
copyright: json.license.trim(),
|
copyright: json.license?.trim(),
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user