From 443768efb81e8db84e7a73e889bd04409e491b85 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Sun, 24 Jun 2018 21:17:51 +0100 Subject: [PATCH 1/6] Bump version to 3.0.2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a2d4d8..9c5efe5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project (mympd C) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/") set(CPACK_PACKAGE_VERSION_MAJOR "3") set(CPACK_PACKAGE_VERSION_MINOR "0") -set(CPACK_PACKAGE_VERSION_PATCH "1") +set(CPACK_PACKAGE_VERSION_PATCH "2") if(CMAKE_BUILD_TYPE MATCHES RELEASE) set(ASSETS_PATH "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/htdocs") From c178705e124042bbc7f0c9821249eaef8ff8dcec Mon Sep 17 00:00:00 2001 From: jcorporation Date: Sun, 24 Jun 2018 21:19:43 +0100 Subject: [PATCH 2/6] Fixed add icon in filesystem browse card --- htdocs/js/mpd.js | 2 +- htdocs/js/mpd.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js index 86ae846..eba0c01 100644 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@ -660,7 +660,7 @@ function parseFilesystem(obj) { } function appendClickableIcon(appendTo, onClickAction, glyphicon) { - $(appendTo).append( + $(appendTo).html( '' + '' + glyphicon + '') .find('a').click(function(e) { diff --git a/htdocs/js/mpd.min.js b/htdocs/js/mpd.min.js index bed849f..cff1185 100644 --- a/htdocs/js/mpd.min.js +++ b/htdocs/js/mpd.min.js @@ -36,7 +36,7 @@ setPagination(a.totalEntities);if(isTouch)$("#QueueList > tbody > tr > td:last-c ")"));$("#btntrashmodedown").hasClass("active")&&(a=$("#QueueList > tbody > tr:gt("+($(this).index()-1)+")"));$.each(a,function(){0==$(this).children().last().has("a").length&&$(this).children().last().append('delete').find("a").fadeTo("fast",1)})},mouseleave:function(){var a= $(this);$("#btntrashmodeup").hasClass("active")&&(a=$("#QueueList > tbody > tr:lt("+($(this).index()+1)+")"));$("#btntrashmodedown").hasClass("active")&&(a=$("#QueueList > tbody > tr:gt("+($(this).index()-1)+")"));$.each(a,function(){$(this).children().last().find("a").stop().remove()})}});$("#QueueList > tbody > tr").on({click:function(){$("#queueList > tbody > tr").removeClass("active");sendAPI({cmd:"MPD_API_PLAY_TRACK",data:{track:$(this).attr("trackid")}});$(this).addClass("active")}})}} function parseSearch(a){"Search"===app.current.app&&($("#panel-heading-search").text(a.totalEntities+" Songs found"),0'+c+"").find("a").click(function(a){a.stopPropagation();sendAPI({cmd:b,data:{uri:decodeURI($(this).parents("tr").attr("uri"))}});showNotification('"'+$("td:nth-last-child(3)",$(this).parents("tr")).text()+'" added',"","","success")})}if("Browse"===app.current.app||"Filesystem"===app.current.tab||"Search"===app.current.app){var c=0,d=document.getElementById(app.current.app+ +function parseFilesystem(a){function b(a,b,c){$(a).html(''+c+"").find("a").click(function(a){a.stopPropagation();sendAPI({cmd:b,data:{uri:decodeURI($(this).parents("tr").attr("uri"))}});showNotification('"'+$("td:nth-last-child(3)",$(this).parents("tr")).text()+'" added',"","","success")})}if("Browse"===app.current.app||"Filesystem"===app.current.tab||"Search"===app.current.app){var c=0,d=document.getElementById(app.current.app+ (void 0==app.current.tab?"":app.current.tab)+"List").getElementsByTagName("tbody")[0].getElementsByTagName("tr"),e;for(e in a.data){c++;var f="",g="";switch(a.data[e].type){case "directory":g=encodeURI(a.data[e].dir);f='folder_open'+basename(a.data[e].dir)+"";break;case "song":f=Math.floor(a.data[e].duration/60);var h=a.data[e].duration-60*f;g=encodeURI(a.data[e].uri);f='music_note'+a.data[e].title+""+a.data[e].artist+""+a.data[e].album+""+f+":"+(10>h?"0":"")+h+"";break;case "playlist":g=encodeURI(a.data[e].plist),f='list'+basename(a.data[e].plist)+""}c<=d.length?$(d[c-1]).attr("uri")!=g&&$(d[c-1]).replaceWith(f):$("#"+app.current.app+ (void 0==app.current.tab?"":app.current.tab)+"List > tbody").append(f)}for(e=d.length;e>c;e--)$(d[d.length-1]).remove();setPagination(a.totalEntities);0==c&&$("#"+app.current.app+app.current.tab+"List > tbody").append('error_outlineNo results');if(isTouch)b($("#"+app.current.app+(void 0==app.current.tab?"":app.current.tab)+"List > tbody > tr.dir > td:last-child"),"MPD_API_ADD_TRACK","playlist_add"),b($("#"+ From 0a9a089f026fc250f2350e646210f96572e47dd2 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Mon, 25 Jun 2018 23:48:41 +0100 Subject: [PATCH 3/6] Fixed track adding in database view --- htdocs/js/mpd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js index eba0c01..2172cb8 100644 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@ -854,14 +854,14 @@ function parseListTitles(obj) { album.append(titleList); $('#card'+id+' > img').on({ click: function() { - sendAPI({"cmd":"MPD_API_ADD_TRACK", "data": { "track": decodeURI($(this).attr('uri'))}}); + sendAPI({"cmd":"MPD_API_ADD_TRACK", "data": { "uri": decodeURI($(this).attr('uri'))}}); showNotification('"'+decodeURI($(this).attr('data-album'))+'" added','','','success'); } }); $('#tbl'+id+' > tbody > tr').on({ click: function() { - sendAPI({"cmd":"MPD_API_ADD_TRACK", "data": { "track": decodeURI($(this).attr('uri'))}}); + sendAPI({"cmd":"MPD_API_ADD_TRACK", "data": { "uri": decodeURI($(this).attr('uri'))}}); showNotification('"' + $('td:nth-last-child(1)', this).text() + '" added','','','success'); } }); From 54b10bdaf366f6171f5890cac529647f393faadb Mon Sep 17 00:00:00 2001 From: jcorporation Date: Mon, 25 Jun 2018 23:55:27 +0100 Subject: [PATCH 4/6] Updated mpd.min.js --- htdocs/js/mpd.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/js/mpd.min.js b/htdocs/js/mpd.min.js index cff1185..aaf91cd 100644 --- a/htdocs/js/mpd.min.js +++ b/htdocs/js/mpd.min.js @@ -54,7 +54,7 @@ b&&$("#"+app.current.app+app.current.tab+app.current.view+"List > tbody").append f='
'+a.searchstr+'

'+a.data[d].value+'

',b<=c.length?c[b-1].id!=e&&$(c[b-1]).replaceWith(f):$("#BrowseDatabaseAlbumCards").append(f),(b>c.length||c[b-1].id!=e)&&sendAPI({cmd:"MPD_API_GET_ARTISTALBUMTITLES", data:{albumartist:a.searchstr,album:a.data[d].value}},parseListTitles);for(d=c.length;d>b;d--)$(c[d-1]).remove();setPagination(a.totalEntities)}doSetFilterLetter("#BrowseDatabaseFilter")}} function parseListTitles(a){if("Browse"===app.current.app||"Database"===app.current.tab||"Album"===app.current.view){var b=genId(a.album),c=$("#card"+b+" > div > table > tbody");$("#card"+b+" > img").attr("src",a.cover).attr("uri",a.data[0].uri.replace(/\/[^\/]+$/,"")).attr("data-album",encodeURI(a.album));var d="",e;for(e in a.data)d+=''+a.data[e].track+""+a.data[e].title+"";c.append(d);$("#card"+b+" > img").on({click:function(){sendAPI({cmd:"MPD_API_ADD_TRACK", -data:{track:decodeURI($(this).attr("uri"))}});showNotification('"'+decodeURI($(this).attr("data-album"))+'" added',"","","success")}});$("#tbl"+b+" > tbody > tr").on({click:function(){sendAPI({cmd:"MPD_API_ADD_TRACK",data:{track:decodeURI($(this).attr("uri"))}});showNotification('"'+$("td:nth-last-child(1)",this).text()+'" added',"","","success")}})}} +data:{uri:decodeURI($(this).attr("uri"))}});showNotification('"'+decodeURI($(this).attr("data-album"))+'" added',"","","success")}});$("#tbl"+b+" > tbody > tr").on({click:function(){sendAPI({cmd:"MPD_API_ADD_TRACK",data:{uri:decodeURI($(this).attr("uri"))}});showNotification('"'+$("td:nth-last-child(1)",this).text()+'" added',"","","success")}})}} function setPagination(a){var b=Math.ceil(a/settings.max_elements_per_page),c=app.current.app+(void 0==app.current.tab?"":app.current.tab);0==b&&(b=1);$("#"+c+"PaginationTopPage").text("Page "+(app.current.page/settings.max_elements_per_page+1)+" / "+b);$("#"+c+"PaginationBottomPage").text("Page "+(app.current.page/settings.max_elements_per_page+1)+" / "+b);if(1'+(d+1)+""),$("#"+c+"PaginationBottomPages").append('")}else $("#"+c+"PaginationTopPage").addClass("disabled").attr("disabled", "disabled"),$("#"+c+"PaginationBottomPage").addClass("disabled").attr("disabled","disabled");a>app.current.page+settings.max_elements_per_page?($("#"+c+"PaginationTopNext").removeClass("disabled").removeAttr("disabled"),$("#"+c+"PaginationBottomNext").removeClass("disabled").removeAttr("disabled"),$("#"+c+"ButtonsBottom").removeClass("hide")):($("#"+c+"PaginationTopNext").addClass("disabled").attr("disabled","disabled"),$("#"+c+"PaginationBottomNext").addClass("disabled").attr("disabled","disabled"), From 4d42ac927bd48beb454c66af2ccbfe6131801dc4 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Tue, 3 Jul 2018 22:57:31 +0100 Subject: [PATCH 5/6] Fix buttons shuffle and clear in queue card --- htdocs/index.html | 4 ++-- htdocs/js/mpd.js | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/index.html b/htdocs/index.html index 5b92042..2032c74 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -122,10 +122,10 @@
- -