From: Hugo Villeneuve Date: Fri, 6 Jan 2023 22:36:29 +0000 (-0500) Subject: Add plist_entry table row class X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=bc655abd8fc39eec41007915818902475b13a6fb;p=ympd.git Add plist_entry table row class --- diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js index cc22913..2f9cd2f 100644 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@ -588,7 +588,20 @@ function webSocketConnect() { '' ); break; - case 'wrap': + case 'plist_entry': + var clazz = 'plist_entry'; + $('#salamisandwich > tbody').append( + '' + + '' + + '' + + obj.data[item].title + + '' + + '' + ); + break; + case 'wrap': if (current_app == 'browse') { $('#next').removeClass('hide'); } else { @@ -658,6 +671,13 @@ function webSocketConnect() { 'MPD_API_ADD_PLAY_TRACK', 'play' ); + appendClickableIcon( + $( + '#salamisandwich > tbody > tr.plist_entry > td:last-child' + ), + 'MPD_API_ADD_PLAY_TRACK', + 'play' + ); } else { $('#salamisandwich > tbody > tr').on({ mouseenter: function () { @@ -673,6 +693,12 @@ function webSocketConnect() { 'MPD_API_ADD_PLAY_TRACK', 'play' ); + else if ($(this).is('.plist_entry')) + appendClickableIcon( + $(this).children().last(), + 'MPD_API_ADD_PLAY_TRACK', + 'play' + ); }, mouseleave: function () { $(this) diff --git a/src/mpd_client.c b/src/mpd_client.c index 522199d..586f4f2 100644 --- a/src/mpd_client.c +++ b/src/mpd_client.c @@ -830,7 +830,7 @@ int mpd_put_playlist(char *buffer, char *pl_name, unsigned int offset) { case MPD_ENTITY_TYPE_SONG: song = mpd_entity_get_song(entity); - cur += json_emit_raw_str(cur, end - cur, "{\"type\":\"song\",\"uri\":"); + cur += json_emit_raw_str(cur, end - cur, "{\"type\":\"plist_entry\",\"uri\":"); cur += json_emit_quoted_str(cur, end - cur, mpd_song_get_uri(song)); cur += json_emit_raw_str(cur, end - cur, ",\"album\":"); cur += json_emit_quoted_str(cur, end - cur, mpd_get_album(song));