Adding description with technical specs
This commit is contained in:
@ -2947,8 +2947,6 @@ function savePlaylist(uri, name, description, is_public, is_collaborative, image
|
|||||||
};sendRequest(dispatch, getState, 'users/' + getState().spotify.me.id + '/playlists/' + helpers.getFromUri('playlistid', uri), 'PUT', data).then(function (response) {
|
};sendRequest(dispatch, getState, 'users/' + getState().spotify.me.id + '/playlists/' + helpers.getFromUri('playlistid', uri), 'PUT', data).then(function (response) {
|
||||||
dispatch(uiActions.createNotification({ content: 'Saved' }));
|
dispatch(uiActions.createNotification({ content: 'Saved' }));
|
||||||
|
|
||||||
console.log({ image: image });
|
|
||||||
|
|
||||||
// Save the image
|
// Save the image
|
||||||
if (image) {
|
if (image) {
|
||||||
sendRequest(dispatch, getState, 'users/' + getState().spotify.me.id + '/playlists/' + helpers.getFromUri('playlistid', uri) + '/images', 'PUT', image).then(function (response) {
|
sendRequest(dispatch, getState, 'users/' + getState().spotify.me.id + '/playlists/' + helpers.getFromUri('playlistid', uri) + '/images', 'PUT', image).then(function (response) {
|
||||||
@ -62005,15 +62003,16 @@ var EditPlaylistModal = function (_React$Component) {
|
|||||||
value: function setImage(e) {
|
value: function setImage(e) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
// Create a file-reader to import the selected image
|
// Create a file-reader to import the selected image as a base64 string
|
||||||
// as a base64 string
|
|
||||||
var file_reader = new FileReader();
|
var file_reader = new FileReader();
|
||||||
|
|
||||||
|
// Once the image is loaded, convert the result
|
||||||
file_reader.addEventListener("load", function (e) {
|
file_reader.addEventListener("load", function (e) {
|
||||||
var image_base64 = e.target.result.replace('data:image/jpeg;base64,', '');
|
var image_base64 = e.target.result.replace('data:image/jpeg;base64,', '');
|
||||||
self.setState({ image: image_base64 });
|
self.setState({ image: image_base64 });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// This calls the filereader to load the file
|
||||||
file_reader.readAsDataURL(e.target.files[0]);
|
file_reader.readAsDataURL(e.target.files[0]);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -62088,7 +62087,7 @@ var EditPlaylistModal = function (_React$Component) {
|
|||||||
_react2.default.createElement(
|
_react2.default.createElement(
|
||||||
'div',
|
'div',
|
||||||
{ className: 'description' },
|
{ className: 'description' },
|
||||||
'Leave empty to keep cover image unchanged'
|
'JPEG only, 256kB max. Leave empty to keep cover image unchanged.'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -34,15 +34,16 @@ export default class EditPlaylistModal extends React.Component{
|
|||||||
setImage(e){
|
setImage(e){
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
// Create a file-reader to import the selected image
|
// Create a file-reader to import the selected image as a base64 string
|
||||||
// as a base64 string
|
|
||||||
var file_reader = new FileReader();
|
var file_reader = new FileReader();
|
||||||
|
|
||||||
|
// Once the image is loaded, convert the result
|
||||||
file_reader.addEventListener("load", function(e){
|
file_reader.addEventListener("load", function(e){
|
||||||
var image_base64 = e.target.result.replace('data:image/jpeg;base64,','');
|
var image_base64 = e.target.result.replace('data:image/jpeg;base64,','');
|
||||||
self.setState({image: image_base64});
|
self.setState({image: image_base64});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// This calls the filereader to load the file
|
||||||
file_reader.readAsDataURL(e.target.files[0]);
|
file_reader.readAsDataURL(e.target.files[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +82,7 @@ export default class EditPlaylistModal extends React.Component{
|
|||||||
onChange={e => this.setImage(e)}
|
onChange={e => this.setImage(e)}
|
||||||
/>
|
/>
|
||||||
<div className="description">
|
<div className="description">
|
||||||
Leave empty to keep cover image unchanged
|
JPEG only, 256kB max. Leave empty to keep cover image unchanged.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1505,8 +1505,6 @@ export function savePlaylist(uri, name, description, is_public, is_collaborative
|
|||||||
response => {
|
response => {
|
||||||
dispatch(uiActions.createNotification({content: 'Saved'}));
|
dispatch(uiActions.createNotification({content: 'Saved'}));
|
||||||
|
|
||||||
console.log({image: image});
|
|
||||||
|
|
||||||
// Save the image
|
// Save the image
|
||||||
if (image){
|
if (image){
|
||||||
sendRequest(dispatch, getState, 'users/'+ getState().spotify.me.id +'/playlists/'+ helpers.getFromUri('playlistid',uri)+'/images', 'PUT', image)
|
sendRequest(dispatch, getState, 'users/'+ getState().spotify.me.id +'/playlists/'+ helpers.getFromUri('playlistid',uri)+'/images', 'PUT', image)
|
||||||
|
|||||||
Reference in New Issue
Block a user