Added functionality to add songs from another channel

This commit is contained in:
Kasper Rynning-Tønnesen
2018-03-21 15:01:14 +01:00
parent 8d14b14c65
commit 859062204c
13 changed files with 230 additions and 34 deletions

View File

@@ -596,6 +596,12 @@ function change_offline(enabled, already_offline){
function toast(msg) {
switch(msg) {
case "other_list_pass":
msg = "The other list has a pass, can't import the songs..";
break;
case "nolist":
msg = "There is no list with that name";
break;
case "suggested_thumbnail":
if(embed) return;
msg = "The thumbnail has been suggested!";

View File

@@ -876,6 +876,22 @@ $(document).on("submit", "#listImport", function(e){
document.getElementById("import").value = "";
});
$(document).on("submit", "#listImportZoff", function(e) {
e.preventDefault();
var new_channel = $("#import_zoff").val();
if(new_channel == "") {
Materialize.toast("It seems you've entered a invalid channel-name.", 4000);
return;
}
socket.emit("import_zoff", {channel: chan.toLowerCase(), new_channel: new_channel.toLowerCase()});
});
$(document).on("click", ".import-zoff", function(e) {
e.preventDefault();
$(".import-zoff-container").addClass("hide");
$(".zoff_add_field").removeClass("hide");
});
$(document).on("submit", "#listImportSpotify", function(e){
e.preventDefault();
if(spotify_authenticated && $("#import_spotify").val() !== ""){