|
@@ -450,16 +450,28 @@
|
|
|
|
|
|
_this.socket.emit('playlists.getFirstSong', _this.privatePlaylistQueueSelected, data => {
|
|
_this.socket.emit('playlists.getFirstSong', _this.privatePlaylistQueueSelected, data => {
|
|
if (data.status === 'success') {
|
|
if (data.status === 'success') {
|
|
- console.log(data.song);
|
|
|
|
- let songId = data.song._id;
|
|
|
|
- _this.automaticallyRequestedSongId = data.song.songId;
|
|
|
|
- _this.socket.emit('stations.addToQueue', _this.station._id, data.song.songId, data2 => {
|
|
|
|
- if (data2.status === 'success') {
|
|
|
|
- _this.socket.emit('playlists.moveSongToBottom', _this.privatePlaylistQueueSelected, data.song.songId, data3 => {
|
|
|
|
- if (data3.status === 'success') {}
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ if (data.song.duration < 15 * 60) {
|
|
|
|
+ console.log(data.song);
|
|
|
|
+ let songId = data.song._id;
|
|
|
|
+ _this.automaticallyRequestedSongId = data.song.songId;
|
|
|
|
+ _this.socket.emit('stations.addToQueue', _this.station._id, data.song.songId, data2 => {
|
|
|
|
+ if (data2.status === 'success') {
|
|
|
|
+ _this.socket.emit('playlists.moveSongToBottom', _this.privatePlaylistQueueSelected, data.song.songId, data3 => {
|
|
|
|
+ if (data3.status === 'success') {
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ Toast.methods.addToast(`Top song in playlist was too long to be added.`, 3000);
|
|
|
|
+ _this.socket.emit('playlists.moveSongToBottom', _this.privatePlaylistQueueSelected, data.song.songId, data3 => {
|
|
|
|
+ if (data3.status === 'success') {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.addFirstPrivatePlaylistSongToQueue();
|
|
|
|
+ }, 3000);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|