Sfoglia il codice sorgente

fixed adding songs issue

AkiraLaine 9 anni fa
parent
commit
2687ad8892
3 ha cambiato i file con 3 aggiunte e 5 eliminazioni
  1. 1 3
      app/client/client.js
  2. 1 1
      app/client/templates/playlist.html
  3. 1 1
      app/server/server.js

+ 1 - 3
app/client/client.js

@@ -306,9 +306,9 @@ Template.room.events({
         } else{
             Meteor.call("addSongToQueue", genre, songData, function(err, res) {
                 console.log(err, res);
-                $("#close-modal-a").click();
             });
         }
+        $("#close-modal-a").click();
     },
     "click #toggle-video": function(e){
         e.preventDefault();
@@ -360,11 +360,9 @@ Template.room.events({
                                         $("#title").val(data.tracks.items[0].name);
                                         var artists = [];
                                         $("#img").val(data.tracks.items[0].album.images[1].url);
-
                                         data.tracks.items[0].artists.forEach(function(artist) {
                                             artists.push(artist.name);
                                         });
-
                                         $("#artist").val(artists.join(", "));
                                     }
                                 });

+ 1 - 1
app/client/templates/playlist.html

@@ -6,7 +6,7 @@
             {{#if current}}<i class="fa fa-arrow-right"></i>{{/if}}
             <p style="float:right;padding-right:10px;font-weight:900">{{formatTime duration}}</p>
             <strong>{{title}}</strong>
-            <p id="artist">{{artist}}</p>
+            <p>{{artist}}</p>
         </li>
       {{/each}}
     </ul>

+ 1 - 1
app/server/server.js

@@ -633,7 +633,7 @@ Meteor.methods({
                 if (Queues.find({type: type}).count() === 0) {
                     Queues.insert({type: type, songs: []});
                 }
-                if (songData !== undefined && Object.keys(songData).length === 5 && songData.type !== undefined && songData.title !== undefined && songData.title !== undefined && songData.artist !== undefined && songData.img !== undefined) {
+                if (songData !== undefined && Object.keys(songData).length === 5 && songData.type !== undefined && songData.title !== undefined && songData.artist !== undefined && songData.img !== undefined) {
                     songData.duration = getSongDuration(songData.title, songData.artist);
                     songData.img = getSongAlbumArt(songData.title, songData.artist);
                     songData.skipDuration = 0;