diff --git a/api/src/processing/services/soundcloud.js b/api/src/processing/services/soundcloud.js index ef35ee2e..c5f0c6eb 100644 --- a/api/src/processing/services/soundcloud.js +++ b/api/src/processing/services/soundcloud.js @@ -113,9 +113,9 @@ export default async function(obj) { if (!file) return { error: "fetch.empty" }; - const artist = json.user.username.trim(); + const artist = json.user?.username?.trim(); const fileMetadata = { - title: json.title.trim(), + title: json.title?.trim(), album: json.publisher_metadata?.album_title?.trim(), artist, album_artist: artist, diff --git a/docs/api.md b/docs/api.md index 36adacb7..f093e148 100644 --- a/docs/api.md +++ b/docs/api.md @@ -132,14 +132,14 @@ all keys in this table are optional. | key | type | description | |:---------------|:---------|:-------------------------------------------| | `album` | `string` | album name or collection title | -| `composer` | `string` | composter of the track | -| `genre` | `string` | genre or genres of the track | +| `composer` | `string` | composer of the track | +| `genre` | `string` | track's genre(s) | | `copyright` | `string` | copyright information or ownership details | | `title` | `string` | title of the track or media file | | `artist` | `string` | artist or creator name | -| `album_artist` | `string` | artist or creator name of the album | +| `album_artist` | `string` | album's artist or creator name | | `track` | `string` | track number or position in album | -| `date` | `string` | release year or creation year | +| `date` | `string` | release date or creation date | #### audio object | key | type | value |