diff --git a/modules/db-read/database-public-sqlite.js b/modules/db-read/database-public-sqlite.js index c59d6e3..b8cd3d3 100644 --- a/modules/db-read/database-public-sqlite.js +++ b/modules/db-read/database-public-sqlite.js @@ -244,7 +244,7 @@ exports.setup = function (mstream, dbSettings){ var albums = {"albums":[]}; // TODO: Make a list of all songs without null albums and add them to the response - var sql = "SELECT DISTINCT album FROM items WHERE artist = ? AND user = ? ORDER BY album COLLATE NOCASE ASC;"; + var sql = "SELECT album, album_art_file FROM items WHERE artist = ? AND user = ? GROUP BY album ORDER BY album COLLATE NOCASE ASC;"; var searchTerms = []; searchTerms.push(req.body.artist); searchTerms.push(req.user.username); @@ -256,11 +256,11 @@ exports.setup = function (mstream, dbSettings){ } var returnArray = []; - for (var i = 0; i < rows.length; i++) { - if(rows[i].album){ + for (let row in rows){ + if(row.album){ albums.albums.push({ - name: rows[i].album, - album_art_file: rows[i].album_art_file + name: row.album, + album_art_file: row.album_art_file }); } } diff --git a/public/css/master.css b/public/css/master.css index de673ee..9596c18 100755 --- a/public/css/master.css +++ b/public/css/master.css @@ -143,7 +143,7 @@ div#jp_container_N { font-weight: 300; border-bottom: solid 1px #b4b4b4; padding: 13px 10px; } - .filez:hover, .dirz:hover, .back:hover, .artistz:hover, .albumz:hover, .playlistz:hover, .playlist-item:hover #playlist_container ul li:hover { + .filez:hover, .back:hover, .artistz:hover, .playlistz:hover, .playlist-item:hover #playlist_container ul li:hover { background-color: #F5F5F5; } .dirz { @@ -192,7 +192,7 @@ div#jp_container_N { list-style-type: none; overflow: hidden; } -.dirz:hover { +.dirz:hover, .albumz:hover, .artistz:hover, .playlistz:hover { background-color: rgba(230, 154, 23, 0.15); } .back:hover { @@ -513,3 +513,15 @@ h3 { .hover-fill:hover{ opacity: 1; } + +.explorer-label-1{ + font-family: 'Jura', sans-serif; + + font-style: normal; + font-size: 17px; + line-height: 100%; +} +.album-art-box{ + height: 50px; + margin-right: 10px; +} diff --git a/public/js/lib/lazy-load.js b/public/js/lib/lazy-load.js new file mode 100644 index 0000000..0a6005f --- /dev/null +++ b/public/js/lib/lazy-load.js @@ -0,0 +1 @@ +var _extends=Object.assign||function(e){for(var t=1;t=o(e)+n+e.offsetHeight},a=function(e,t,n){return(t===window?window.pageXOffset:s(t))>=s(e)+n+e.offsetWidth},c=function(e,t,n){return!(i(e,t,n)||l(e,t,n)||r(e,t,n)||a(e,t,n))},u=function(e,t){var n=new e(t),o=new CustomEvent("LazyLoad::Initialized",{detail:{instance:n}});window.dispatchEvent(o)},d=function(e,t){return e.getAttribute("data-"+t)},h=function(e,t,n){return e.setAttribute("data-"+t,n)},f=function(e,t){var n=e.parentElement;if("PICTURE"===n.tagName)for(var o=0;o0;)e.splice(o.pop(),1)},_startScrollHandler:function(){this._isHandlingScroll||(this._isHandlingScroll=!0,this._settings.container.addEventListener("scroll",this._boundHandleScroll))},_stopScrollHandler:function(){this._isHandlingScroll&&(this._isHandlingScroll=!1,this._settings.container.removeEventListener("scroll",this._boundHandleScroll))},handleScroll:function(){var e=this._settings.throttle;if(0!==e){var t=Date.now(),n=e-(t-this._previousLoopTime);n<=0||n>e?(this._loopTimeout&&(clearTimeout(this._loopTimeout),this._loopTimeout=null),this._previousLoopTime=t,this._loopThroughElements()):this._loopTimeout||(this._loopTimeout=setTimeout(function(){this._previousLoopTime=Date.now(),this._loopTimeout=null,this._loopThroughElements()}.bind(this),n))}else this._loopThroughElements()},update:function(){this._elements=Array.prototype.slice.call(this._queryOriginNode.querySelectorAll(this._settings.elements_selector)),this._purgeElements(),this._loopThroughElements(),this._startScrollHandler()},destroy:function(){window.removeEventListener("resize",this._boundHandleScroll),this._loopTimeout&&(clearTimeout(this._loopTimeout),this._loopTimeout=null),this._stopScrollHandler(),this._elements=null,this._queryOriginNode=null,this._settings=null}};var w=window.lazyLoadOptions;return w&&function(e,t){var n=t.length;if(n)for(var o=0;o'+value.name+' '); + if(value.album_art_file){ + albums.push('
'+value.name+'
'); + }else{ + albums.push('
'+value.name+'
'); + } currentBrowsingList.push({type: 'album', name: value.name}); }); $('#filelist').html(albums); + ll.update(); }); }); @@ -633,6 +638,7 @@ $(document).ready(function(){ $("#filelist").on('click', '.artistz', function() { var artist = $(this).data('artist'); + resetPanel('Artist', 'scrollBoxHeight1'); MSTREAMAPI.artistAlbums(artist, function(response, error){ $('#search_folders').val(''); @@ -641,18 +647,20 @@ $(document).ready(function(){ return boilerplateFailure(response, error); } //clear the list - $('#filelist').empty(); currentBrowsingList = []; var albums = []; $.each(response.albums, function(index, value) { - albums.push('
'+value.name+'
'); + if(value.album_art_file){ + albums.push('
'+value.name+'
'); + }else{ + albums.push('
'+value.name+'
'); + } currentBrowsingList.push({type: 'album', name: value.name}) }); $('#filelist').html(albums); - $('.panel_one_name').html('Albums'); - $('.directoryName').html('Artist: ' + artist); + ll.update(); }); }); diff --git a/public/mstream.html b/public/mstream.html index b8fe581..05fed07 100755 --- a/public/mstream.html +++ b/public/mstream.html @@ -376,4 +376,11 @@ $(document).foundation(); + + +