Skip to content

Commit

Permalink
Make artist, title optional when adding playlist items (#516)
Browse files Browse the repository at this point in the history
If not given, üWave will use defaults from the media source.

This is important for u-wave/web#1855. Media
sources will respond with original titles in search and import requests.
When dragging those media into a playlist from search results, the
client will not send an artist and title field, and üWave will request
them from the media source again, but this time it will respond with
derived data.
  • Loading branch information
goto-bus-stop committed May 18, 2022
1 parent 56860d9 commit b1712f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/plugins/playlists.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const routes = require('../routes/playlists');
* @typedef {object} PlaylistItemDesc
* @prop {string} sourceType
* @prop {string|number} sourceID
* @prop {string} artist
* @prop {string} title
* @prop {string} [artist]
* @prop {string} [title]
* @prop {number} [start]
* @prop {number} [end]
*/
Expand Down
2 changes: 1 addition & 1 deletion src/validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ exports.addPlaylistItems = /** @type {const} */ ({
artist: { type: 'string' },
title: { type: 'string' },
},
required: ['sourceType', 'sourceID', 'artist', 'title'],
required: ['sourceType', 'sourceID'],
},
},
},
Expand Down

0 comments on commit b1712f3

Please sign in to comment.