1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-09-28 14:18:40 +00:00

Feat: add last played tab to queue card

This commit is contained in:
jcorporation 2018-11-14 23:14:47 +00:00
parent bf317d4039
commit 34c0506a3b
10 changed files with 143 additions and 135 deletions

View File

@ -70,9 +70,9 @@ post_upgrade() {
[ -f /var/lib/mympd/state/colsPlayback ] || echo -n '["Artist","Album","Genre"]' > /var/lib/mympd/state/colsPlayback [ -f /var/lib/mympd/state/colsPlayback ] || echo -n '["Artist","Album","Genre"]' > /var/lib/mympd/state/colsPlayback
[ -f /var/lib/mympd/state/colsBrowseFilesystem ] || echo -n '["Type","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowseFilesystem [ -f /var/lib/mympd/state/colsBrowseFilesystem ] || echo -n '["Type","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowseFilesystem
[ -f /var/lib/mympd/state/colsBrowsePlaylistsDetail ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowsePlaylistsDetail [ -f /var/lib/mympd/state/colsBrowsePlaylistsDetail ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowsePlaylistsDetail
[ -f /var/lib/mympd/state/colsQueue ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsQueue [ -f /var/lib/mympd/state/colsQueueCurrent ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsQueueCurrent
[ -f /var/lib/mympd/state/colsSearch ] || echo -n '["Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsSearch [ -f /var/lib/mympd/state/colsSearch ] || echo -n '["Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsSearch
[ -f /var/lib/mympd/state/colsLastPlayed ] || echo -n '["Pos","Title","Artist","Album","LastPlayed"]' > /var/lib/mympd/state/colsLastPlayed [ -f /var/lib/mympd/state/colsQueueLastPlayed ] || echo -n '["Pos","Title","Artist","Album","LastPlayed"]' > /var/lib/mympd/state/colsQueueLastPlayed
# fix ownership of /var/lib/mympd # fix ownership of /var/lib/mympd
echo "INFO: Fixing ownership of /var/lib/mympd" echo "INFO: Fixing ownership of /var/lib/mympd"

View File

@ -85,9 +85,9 @@ done
[ -f /var/lib/mympd/state/colsBrowseFilesystem ] || echo -n '["Type","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowseFilesystem [ -f /var/lib/mympd/state/colsBrowseFilesystem ] || echo -n '["Type","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowseFilesystem
[ -f /var/lib/mympd/state/colsPlayback ] || echo -n '["Artist","Album","Genre"]' > /var/lib/mympd/state/colsPlayback [ -f /var/lib/mympd/state/colsPlayback ] || echo -n '["Artist","Album","Genre"]' > /var/lib/mympd/state/colsPlayback
[ -f /var/lib/mympd/state/colsBrowsePlaylistsDetail ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowsePlaylistsDetail [ -f /var/lib/mympd/state/colsBrowsePlaylistsDetail ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowsePlaylistsDetail
[ -f /var/lib/mympd/state/colsQueue ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsQueue [ -f /var/lib/mympd/state/colsQueueCurrent ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsQueueCurrent
[ -f /var/lib/mympd/state/colsSearch ] || echo -n '["Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsSearch [ -f /var/lib/mympd/state/colsSearch ] || echo -n '["Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsSearch
[ -f /var/lib/mympd/state/colsLastPlayed ] || echo -n '["Pos","Title","Artist","Album","LastPlayed"]' > /var/lib/mympd/state/colsLastPlayed [ -f /var/lib/mympd/state/colsQueueLastPlayed ] || echo -n '["Pos","Title","Artist","Album","LastPlayed"]' > /var/lib/mympd/state/colsQueueLastPlayed
echo "Fixing ownership of /var/lib/mympd" echo "Fixing ownership of /var/lib/mympd"
chown -R mympd.mympd /var/lib/mympd chown -R mympd.mympd /var/lib/mympd

4
debian/postinst vendored
View File

@ -65,8 +65,8 @@ fi
[ -f /var/lib/mympd/state/colsBrowseFilesystem ] || echo -n '["Type","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowseFilesystem [ -f /var/lib/mympd/state/colsBrowseFilesystem ] || echo -n '["Type","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowseFilesystem
[ -f /var/lib/mympd/state/colsPlayback ] || echo -n '["Artist","Album","Genre"]' > /var/lib/mympd/state/colsPlayback [ -f /var/lib/mympd/state/colsPlayback ] || echo -n '["Artist","Album","Genre"]' > /var/lib/mympd/state/colsPlayback
[ -f /var/lib/mympd/state/colsBrowsePlaylistsDetail ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowsePlaylistsDetail [ -f /var/lib/mympd/state/colsBrowsePlaylistsDetail ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsBrowsePlaylistsDetail
[ -f /var/lib/mympd/state/colsQueue ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsQueue [ -f /var/lib/mympd/state/colsQueueCurrent ] || echo -n '["Pos","Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsQueueCurrent
[ -f /var/lib/mympd/state/colsLastPlayed ] || echo -n '["Pos","Title","Artist","Album","LastPlayed"]' > /var/lib/mympd/state/colsLastPlayed [ -f /var/lib/mympd/state/colsQueueLastPlayed ] || echo -n '["Pos","Title","Artist","Album","LastPlayed"]' > /var/lib/mympd/state/colsQueueLastPlayed
[ -f /var/lib/mympd/state/colsSearch ] || echo -n '["Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsSearch [ -f /var/lib/mympd/state/colsSearch ] || echo -n '["Title","Artist","Album","Duration"]' > /var/lib/mympd/state/colsSearch
echo "Fixing ownership of /var/lib/mympd" echo "Fixing ownership of /var/lib/mympd"

View File

@ -320,4 +320,8 @@ div.key {
width: 20px; width: 20px;
heigth: 20px; heigth: 20px;
text-align: center; text-align: center;
}
#QueueCurrentLength, #QueueLastPlayedLength {
padding-top: 5px;
} }

View File

@ -109,11 +109,19 @@
</div> </div>
<div class="card hide" id="cardQueue"> <div class="card hide" id="cardQueue">
<div class="card-header"> <div class="card-header" id="cardHeaderQueue">
Queue<span id="panel-heading-queue" class="text pull-right"></span> <ul class="nav nav-tabs card-header-tabs">
<li class="nav-item">
<a data-href='{"cmd": "appGoto", "options": ["Queue", "Current"]}' class="nav-link text-dark" href="#" id="cardQueueNavCurrent">Queue</a>
</li>
<li class="nav-item">
<a data-href='{"cmd": "appGoto", "options": ["Queue", "LastPlayed"]}' class="nav-link text-dark" href="#" id="cardQueueNavLastPlayed">Last Played</a>
</li>
</ul>
</div> </div>
<div class="card-body">
<div class="btn-toolbar card-toolbar" id="queue-buttons"> <div class="card-body hide" id="cardQueueCurrent">
<div class="btn-toolbar card-toolbar" id="QueueCurrentButtonsTop">
<div class="btn-group mr-2 featPlaylists"> <div class="btn-group mr-2 featPlaylists">
<button type="button" class="btn btn-secondary material-icons" data-toggle="modal" data-target="#modalSaveQueue" title="Save queue"> <button type="button" class="btn btn-secondary material-icons" data-toggle="modal" data-target="#modalSaveQueue" title="Save queue">
save save
@ -147,25 +155,27 @@
</div> </div>
</div> </div>
</form> </form>
<div id="QueuePaginationTop" class="btn-group mr-2 hide"> <div id="QueueCurrentPaginationTop" class="btn-group mr-2 hide">
<button data-href='{"cmd": "gotoPage", "options": ["prev"]}' id="QueuePaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">&laquo;</button> <button data-href='{"cmd": "gotoPage", "options": ["prev"]}' id="QueueCurrentPaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">&laquo;</button>
<div class="input-group-append"> <div class="input-group-append">
<button id="QueuePaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">1 / 1</button> <button id="QueueCurrentPaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">1 / 1</button>
<div class="dropdown-menu bg-dark px-2 pages" id="QueuePaginationTopPages"> <div class="dropdown-menu bg-dark px-2 pages" id="QueueCurrentPaginationTopPages">
</div> </div>
</div> </div>
<button data-href='{"cmd": "gotoPage", "options": ["next"]}' id="QueuePaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">&raquo;</button> <button data-href='{"cmd": "gotoPage", "options": ["next"]}' id="QueueCurrentPaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">&raquo;</button>
</div> </div>
<div class="btn-group mr-2 featTags"> <div class="btn-group mr-2 featTags">
<button id="QueueColsBtn" class="btn btn-secondary dropdown-toggle material-icons" type="button" data-toggle="dropdown">settings</button> <button id="QueueCurrentColsBtn" class="btn btn-secondary dropdown-toggle material-icons" type="button" data-toggle="dropdown">settings</button>
<div class="dropdown-menu bg-dark px-2" id="QueueColsDropdown"><form></form> <div class="dropdown-menu bg-dark px-2" id="QueueCurrentColsDropdown"><form></form>
<button data-href='{"cmd": "saveCols", "options": ["Queue"]}' class="btn btn-success btn-block btn-sm mt-2">Apply</button> <button data-href='{"cmd": "saveCols", "options": ["QueueCurrent"]}' class="btn btn-success btn-block btn-sm mt-2">Apply</button>
</div> </div>
</div> </div>
<div class="btn-group mr-2" id="QueueCurrentLength">
</div>
</div> </div>
<div class="table-responsive-md"> <div class="table-responsive-md">
<table id="QueueList" class="table table-hover table-sm" data-version=""> <table id="QueueCurrentList" class="table table-hover table-sm" data-version="">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
@ -180,48 +190,47 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="btn-toolbar hide" id="QueueButtonsBottom"> <div class="btn-toolbar hide" id="QueueCurrentButtonsBottom">
<div class="btn-group mr-2"> <div class="btn-group mr-2">
<button type="button" class="btn btn-secondary material-icons" data-href='{"cmd": "scrollTo", "options: [0]}' title="To top"> <button type="button" class="btn btn-secondary material-icons" data-href='{"cmd": "scrollTo", "options: [0]}' title="To top">
keyboard_arrow_up keyboard_arrow_up
</button> </button>
</div> </div>
<div id="QueuePaginationBottom" class="btn-group mr-2 dropup"> <div id="QueueCurrentPaginationBottom" class="btn-group mr-2 dropup">
<button data-href='{"cmd": "gotoPage", "options": ["prev"]}' id="QueuePaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">&laquo;</button> <button data-href='{"cmd": "gotoPage", "options": ["prev"]}' id="QueueCurrentPaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">&laquo;</button>
<div class="input-group-append"> <div class="input-group-append">
<button id="QueuePaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">1 / 1</button> <button id="QueueCurrentPaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">1 / 1</button>
<div class="dropdown-menu bg-dark px-2 pages" id="QueuePaginationBottomPages"> <div class="dropdown-menu bg-dark px-2 pages" id="QueueCurrentPaginationBottomPages">
</div> </div>
</div> </div>
<button data-href='{"cmd": "gotoPage", "options": ["next"]}' id="QueuePaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">&raquo;</button> <button data-href='{"cmd": "gotoPage", "options": ["next"]}' id="QueueCurrentPaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">&raquo;</button>
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="card-body hide" id="cardQueueLastPlayed">
<div class="card hide" id="cardLastPlayed">
<div class="card-header">Last Played Songs<span id="panel-heading-last-played" class="text pull-right"></span></div>
<div class="card-body">
<div class="btn-toolbar card-toolbar"> <div class="btn-toolbar card-toolbar">
<div id="LastPlayedPaginationTop" class="btn-group mr-2 hide"> <div id="QueueLastPlayedPaginationTop" class="btn-group mr-2 hide">
<button data-href='{"cmd": "gotoPage", "options": ["prev"]}' id="LastPlayedPaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">&laquo;</button> <button data-href='{"cmd": "gotoPage", "options": ["prev"]}' id="QueueLastPlayedPaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">&laquo;</button>
<div class="input-group-append"> <div class="input-group-append">
<button id="LastPlayedPaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">1 / 1</button> <button id="QueueLastPlayedPaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">1 / 1</button>
<div class="dropdown-menu bg-dark px-2 pages" id="LastPlayedPaginationTopPages"> <div class="dropdown-menu bg-dark px-2 pages" id="QueueLastPlayedPaginationTopPages">
</div> </div>
</div> </div>
<button data-href='{"cmd": "gotoPage", "options": ["next"]}' id="LastPlayedPaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">&raquo;</button> <button data-href='{"cmd": "gotoPage", "options": ["next"]}' id="QueueLastPlayedPaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">&raquo;</button>
</div> </div>
<div class="btn-group mr-2 featTags"> <div class="btn-group mr-2 featTags">
<button id="LastPlayedColsBtn" class="btn btn-secondary dropdown-toggle material-icons" type="button" data-toggle="dropdown">settings</button> <button id="QueueLastPlayedColsBtn" class="btn btn-secondary dropdown-toggle material-icons" type="button" data-toggle="dropdown">settings</button>
<div class="dropdown-menu bg-dark px-2" id="LastPlayedColsDropdown"><form></form> <div class="dropdown-menu bg-dark px-2" id="QueueLastPlayedColsDropdown"><form></form>
<button data-href='{"cmd": "saveCols", "options": ["LastPlayed"]}' class="btn btn-success btn-block btn-sm mt-2">Apply</button> <button data-href='{"cmd": "saveCols", "options": ["QueueLastPlayed"]}' class="btn btn-success btn-block btn-sm mt-2">Apply</button>
</div> </div>
</div> </div>
<div class="btn-group mr-2" id="QueueLastPlayedLength">
</div>
</div> </div>
<div class="table-responsive-md"> <div class="table-responsive-md">
<table id="LastPlayedList" class="table table-hover table-sm"> <table id="QueueLastPlayedList" class="table table-hover table-sm">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
@ -236,27 +245,27 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="btn-toolbar hide" id="LastPlayedButtonsBottom"> <div class="btn-toolbar hide" id="QueueLastPlayedButtonsBottom">
<div class="btn-group mr-2"> <div class="btn-group mr-2">
<button type="button" class="btn btn-secondary material-icons" data-href='{"cmd": "scrollTo", "options: [0]}' title="To top"> <button type="button" class="btn btn-secondary material-icons" data-href='{"cmd": "scrollTo", "options: [0]}' title="To top">
keyboard_arrow_up keyboard_arrow_up
</button> </button>
</div> </div>
<div id="LastPlayedPaginationBottom" class="btn-group mr-2 dropup"> <div id="QueueLastPlayedPaginationBottom" class="btn-group mr-2 dropup">
<button data-href='{"cmd": "gotoPage", "options": ["prev"]}' id="LastPlayedPaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">&laquo;</button> <button data-href='{"cmd": "gotoPage", "options": ["prev"]}' id="QueueLastPlayedPaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">&laquo;</button>
<div class="input-group-append"> <div class="input-group-append">
<button id="LastPlayedPaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">1 / 1</button> <button id="QueueLastPlayedPaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">1 / 1</button>
<div class="dropdown-menu bg-dark px-2 pages" id="LastPlayedPaginationBottomPages"> <div class="dropdown-menu bg-dark px-2 pages" id="QueueLastPlayedPaginationBottomPages">
</div> </div>
</div> </div>
<button data-href='{"cmd": "gotoPage", "options": ["next"]}' id="LastPlayedPaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">&raquo;</button> <button data-href='{"cmd": "gotoPage", "options": ["next"]}' id="QueueLastPlayedPaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">&raquo;</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="card hide" id="cardBrowse"> <div class="card hide" id="cardBrowse">
<div class="card-header" id="panel-heading-browse"> <div class="card-header" id="cardHeaderBrowse">
<ul class="nav nav-tabs card-header-tabs"> <ul class="nav nav-tabs card-header-tabs">
<li class="nav-item featTags"> <li class="nav-item featTags">
<a data-href='{"cmd": "appGoto", "options": ["Browse", "Database"]}' class="nav-link text-dark" href="#" id="cardBrowseNavDatabase">Database</a> <a data-href='{"cmd": "appGoto", "options": ["Browse", "Database"]}' class="nav-link text-dark" href="#" id="cardBrowseNavDatabase">Database</a>

View File

@ -15,11 +15,12 @@ var keymap = {
"y": {"cmd": "openModal", "options": ["modalAbout"], "action": "Open About"}, "y": {"cmd": "openModal", "options": ["modalAbout"], "action": "Open About"},
"i": {"cmd": "clickTitle", "options": [], "action": "Open Song Details"}, "i": {"cmd": "clickTitle", "options": [], "action": "Open Song Details"},
"1": {"cmd": "appGoto", "options": ["Playback"], "action": "Goto Playback"}, "1": {"cmd": "appGoto", "options": ["Playback"], "action": "Goto Playback"},
"2": {"cmd": "appGoto", "options": ["Queue"], "action": "Goto Queue"}, "2": {"cmd": "appGoto", "options": ["Queue","Current"], "action": "Goto Queue"},
"3": {"cmd": "appGoto", "options": ["Browse","Database"], "action": "Goto Browse Database"}, "3": {"cmd": "appGoto", "options": ["Queue","LastPlayed"], "action": "Goto Last Played"},
"4": {"cmd": "appGoto", "options": ["Browse","Playlists"], "action": "Goto Browse Playlists"}, "4": {"cmd": "appGoto", "options": ["Browse","Database"], "action": "Goto Browse Database"},
"5": {"cmd": "appGoto", "options": ["Browse","Filesystem"], "action": "Goto Browse Filesystem"}, "5": {"cmd": "appGoto", "options": ["Browse","Playlists"], "action": "Goto Browse Playlists"},
"6": {"cmd": "appGoto", "options": ["Search"], "action": "Goto Search"}, "6": {"cmd": "appGoto", "options": ["Browse","Filesystem"], "action": "Goto Browse Filesystem"},
"7": {"cmd": "appGoto", "options": ["Search"], "action": "Goto Search"},
"m": {"cmd": "openDropdown", "options": ["dropdownMainMenu"], "action": "Open Main Menu"}, "m": {"cmd": "openDropdown", "options": ["dropdownMainMenu"], "action": "Open Main Menu"},
"v": {"cmd": "openDropdown", "options": ["dropdownVolumeMenu"], "action": "Open Volume Menu"}, "v": {"cmd": "openDropdown", "options": ["dropdownVolumeMenu"], "action": "Open Volume Menu"},
"S": {"cmd": "MPD_API_QUEUE_SHUFFLE", "options": [], "action": "Shuffle Queue"}, "S": {"cmd": "MPD_API_QUEUE_SHUFFLE", "options": [], "action": "Shuffle Queue"},

View File

@ -38,8 +38,12 @@ var playlistEl;
var app = {}; var app = {};
app.apps = { "Playback": { "state": "0/-/", "scrollPos": 0 }, app.apps = { "Playback": { "state": "0/-/", "scrollPos": 0 },
"Queue": { "state": "0/any/", "scrollPos": 0 }, "Queue": {
"LastPlayed": { "state": "0/any/", "scrollPos": 0 }, "active": "Current",
"tabs": { "Current": { "state": "0/any/", "scrollPos": 0 },
"LastPlayed": { "state": "0/any/", "scrollPos": 0 }
}
},
"Browse": { "Browse": {
"active": "Database", "active": "Database",
"tabs": { "Filesystem": { "state": "0/-/", "scrollPos": 0 }, "tabs": { "Filesystem": { "state": "0/-/", "scrollPos": 0 },
@ -65,8 +69,10 @@ app.last = { "app": undefined, "tab": undefined, "view": undefined, "filter": ""
var domCache = {}; var domCache = {};
domCache.navbarBottomBtns = document.getElementById('navbar-bottom').getElementsByTagName('div'); domCache.navbarBottomBtns = document.getElementById('navbar-bottom').getElementsByTagName('div');
domCache.navbarBottomBtnsLen = domCache.navbarBottomBtns.length; domCache.navbarBottomBtnsLen = domCache.navbarBottomBtns.length;
domCache.panelHeadingBrowse = document.getElementById('panel-heading-browse').getElementsByTagName('a'); domCache.cardHeaderBrowse = document.getElementById('cardHeaderBrowse').getElementsByTagName('a');
domCache.panelHeadingBrowseLen = domCache.panelHeadingBrowse.length; domCache.cardHeaderBrowseLen = domCache.cardHeaderBrowse.length;
domCache.cardHeaderQueue = document.getElementById('cardHeaderQueue').getElementsByTagName('a');
domCache.cardHeaderQueueLen = domCache.cardHeaderQueue.length;
domCache.counter = document.getElementById('counter'); domCache.counter = document.getElementById('counter');
domCache.volumePrct = document.getElementById('volumePrct'); domCache.volumePrct = document.getElementById('volumePrct');
domCache.volumeControl = document.getElementById('volumeControl'); domCache.volumeControl = document.getElementById('volumeControl');
@ -111,13 +117,15 @@ function appPrepare(scrollPos) {
document.getElementById('cardPlayback').classList.add('hide'); document.getElementById('cardPlayback').classList.add('hide');
document.getElementById('cardQueue').classList.add('hide'); document.getElementById('cardQueue').classList.add('hide');
document.getElementById('cardBrowse').classList.add('hide'); document.getElementById('cardBrowse').classList.add('hide');
document.getElementById('cardSearch').classList.add('hide'); document.getElementById('cardQueueLastPlayed').classList.add('hide');
document.getElementById('cardLastPlayed').classList.add('hide'); for (var i = 0; i < domCache.cardHeaderBrowseLen; i++)
for (var i = 0; i < domCache.panelHeadingBrowseLen; i++) { domCache.cardHeaderBrowse[i].classList.remove('active');
domCache.panelHeadingBrowse[i].classList.remove('active'); for (var i = 0; i < domCache.cardHeaderQueueLen; i++)
} domCache.cardHeaderQueue[i].classList.remove('active');
document.getElementById('cardQueueCurrent').classList.add('hide');
document.getElementById('cardQueueLastPlayed').classList.add('hide');
document.getElementById('cardBrowsePlaylists').classList.add('hide'); document.getElementById('cardBrowsePlaylists').classList.add('hide');
document.getElementById('cardBrowseDatabase').classList.add('hide'); document.getElementById('cardBrowseDatabase').classList.add('hide');
document.getElementById('cardBrowseFilesystem').classList.add('hide'); document.getElementById('cardBrowseFilesystem').classList.add('hide');
//show active card + nav //show active card + nav
document.getElementById('card' + app.current.app).classList.remove('hide'); document.getElementById('card' + app.current.app).classList.remove('hide');
@ -192,7 +200,8 @@ function appRoute() {
app.current.page = parseInt(params[5]); app.current.page = parseInt(params[5]);
app.current.filter = params[6]; app.current.filter = params[6];
app.current.search = params[7]; app.current.search = params[7];
} else { }
else {
appGoto('Playback'); appGoto('Playback');
return; return;
} }
@ -202,11 +211,11 @@ function appRoute() {
if (app.current.app == 'Playback') { if (app.current.app == 'Playback') {
sendAPI({"cmd": "MPD_API_PLAYER_CURRENT_SONG"}, songChange); sendAPI({"cmd": "MPD_API_PLAYER_CURRENT_SONG"}, songChange);
} }
else if (app.current.app == 'Queue' ) { else if (app.current.app == 'Queue' && app.current.tab == 'Current' ) {
selectTag('searchqueuetags', 'searchqueuetagsdesc', app.current.filter); selectTag('searchqueuetags', 'searchqueuetagsdesc', app.current.filter);
getQueue(); getQueue();
} }
else if (app.current.app == 'LastPlayed') { else if (app.current.app == 'Queue' && app.current.tab == 'LastPlayed') {
sendAPI({"cmd": "MPD_API_QUEUE_LAST_PLAYED", "data": {"offset": app.current.page}}, parseLastPlayed); sendAPI({"cmd": "MPD_API_QUEUE_LAST_PLAYED", "data": {"offset": app.current.page}}, parseLastPlayed);
} }
else if (app.current.app == 'Browse' && app.current.tab == 'Playlists' && app.current.view == 'All') { else if (app.current.app == 'Browse' && app.current.tab == 'Playlists' && app.current.view == 'All') {
@ -461,14 +470,14 @@ function appInit() {
toggleBtn(event.target.id); toggleBtn(event.target.id);
}, false); }, false);
document.getElementById('QueueList').addEventListener('click', function(event) { document.getElementById('QueueCurrentList').addEventListener('click', function(event) {
if (event.target.nodeName == 'TD') if (event.target.nodeName == 'TD')
sendAPI({"cmd": "MPD_API_PLAYER_PLAY_TRACK","data": {"track": event.target.parentNode.getAttribute('data-trackid')}}); sendAPI({"cmd": "MPD_API_PLAYER_PLAY_TRACK","data": {"track": event.target.parentNode.getAttribute('data-trackid')}});
else if (event.target.nodeName == 'A') else if (event.target.nodeName == 'A')
showMenu(event.target, event); showMenu(event.target, event);
}, false); }, false);
document.getElementById('LastPlayedList').addEventListener('click', function(event) { document.getElementById('QueueLastPlayedList').addEventListener('click', function(event) {
if (event.target.nodeName == 'A') if (event.target.nodeName == 'A')
showMenu(event.target, event); showMenu(event.target, event);
}, false); }, false);
@ -578,8 +587,8 @@ function appInit() {
appGoto(app.current.app, app.current.tab, app.current.view, app.current.page + '/' + event.target.getAttribute('data-tag') + '/' + app.current.search); appGoto(app.current.app, app.current.tab, app.current.view, app.current.page + '/' + event.target.getAttribute('data-tag') + '/' + app.current.search);
}, false); }, false);
var dropdowns = ['QueueColsDropdown', 'BrowseFilesystemColsDropdown', 'SearchColsDropdown', 'BrowsePlaylistsDetailColsDropdown', var dropdowns = ['QueueCurrentColsDropdown', 'BrowseFilesystemColsDropdown', 'SearchColsDropdown', 'BrowsePlaylistsDetailColsDropdown',
'BrowseDatabaseColsDropdown', 'PlaybackColsDropdown', 'LastPlayedColsDropdown']; 'BrowseDatabaseColsDropdown', 'PlaybackColsDropdown', 'QueueLastPlayedColsDropdown'];
for (var i = 0; i < dropdowns.length; i++) { for (var i = 0; i < dropdowns.length; i++) {
document.getElementById(dropdowns[i]).addEventListener('click', function(event) { document.getElementById(dropdowns[i]).addEventListener('click', function(event) {
if (event.target.nodeName == 'INPUT') if (event.target.nodeName == 'INPUT')
@ -611,10 +620,10 @@ function appInit() {
hideMenu(); hideMenu();
}, false); }, false);
dragAndDropTable('QueueList'); dragAndDropTable('QueueCurrentList');
dragAndDropTable('BrowsePlaylistsDetailList'); dragAndDropTable('BrowsePlaylistsDetailList');
dragAndDropTableHeader('Queue'); dragAndDropTableHeader('QueueCurrent');
dragAndDropTableHeader('LastPlayed'); dragAndDropTableHeader('QueueLastPlayed');
dragAndDropTableHeader('Search'); dragAndDropTableHeader('Search');
dragAndDropTableHeader('BrowseFilesystem'); dragAndDropTableHeader('BrowseFilesystem');
dragAndDropTableHeader('BrowsePlaylistsDetail'); dragAndDropTableHeader('BrowsePlaylistsDetail');
@ -769,7 +778,7 @@ function dragAndDropTable(table) {
tr[i].classList.remove('dragover'); tr[i].classList.remove('dragover');
} }
document.getElementById(table).classList.add('opacity05'); document.getElementById(table).classList.add('opacity05');
if (app.current.app == 'Queue') if (app.current.app == 'Queue' && app.current.tab == 'Current')
sendAPI({"cmd": "MPD_API_QUEUE_MOVE_TRACK","data": {"from": oldSongpos, "to": newSongpos}}); sendAPI({"cmd": "MPD_API_QUEUE_MOVE_TRACK","data": {"from": oldSongpos, "to": newSongpos}});
else if (app.current.app == 'Browse' && app.current.tab == 'Playlists' && app.current.view == 'Detail') else if (app.current.app == 'Browse' && app.current.tab == 'Playlists' && app.current.view == 'Detail')
playlistMoveTrack(oldSongpos, newSongpos); playlistMoveTrack(oldSongpos, newSongpos);
@ -978,11 +987,11 @@ function filterCols(x) {
if (settings.featTags == false) if (settings.featTags == false)
tags.push('Title'); tags.push('Title');
tags.push('Duration'); tags.push('Duration');
if (x == 'colsQueue' || x == 'colsBrowsePlaylistsDetail' || x == 'colsLastPlayed') if (x == 'colsQueueCurrent' || x == 'colsBrowsePlaylistsDetail' || x == 'colsQueueLastPlayed')
tags.push('Pos'); tags.push('Pos');
else if (x == 'colsBrowseFilesystem') else if (x == 'colsBrowseFilesystem')
tags.push('Type'); tags.push('Type');
if (x == 'colsLastPlayed') if (x == 'colsQueueLastPlayed')
tags.push('LastPlayed'); tags.push('LastPlayed');
var cols = []; var cols = [];
@ -1061,8 +1070,8 @@ function parseSettings(obj) {
app.apps.Browse.active = 'Filesystem'; app.apps.Browse.active = 'Filesystem';
app.apps.Search.state = '0/filename/'; app.apps.Search.state = '0/filename/';
app.apps.Queue.state = '0/filename/'; app.apps.Queue.state = '0/filename/';
settings.colsQueue = ["Pos", "Title", "Duration"]; settings.colsQueueCurrent = ["Pos", "Title", "Duration"];
settings.colsLastPlayed = ["Pos", "Title", "LastPlayed"]; settings.colsQueueLastPlayed = ["Pos", "Title", "LastPlayed"];
settings.colsSearch = ["Title", "Duration"]; settings.colsSearch = ["Title", "Duration"];
settings.colsBrowseFilesystem = ["Type", "Title", "Duration"]; settings.colsBrowseFilesystem = ["Type", "Title", "Duration"];
settings.colsBrowseDatabase = ["Track", "Title", "Duration"]; settings.colsBrowseDatabase = ["Track", "Title", "Duration"];
@ -1116,8 +1125,8 @@ function parseSettings(obj) {
settings.searchtags.sort(); settings.searchtags.sort();
settings.browsetags.sort(); settings.browsetags.sort();
filterCols('colsSearch'); filterCols('colsSearch');
filterCols('colsQueue'); filterCols('colsQueueCurrent');
filterCols('colsLastPlayed'); filterCols('colsQueueLastPlayed');
filterCols('colsBrowsePlaylistsDetail'); filterCols('colsBrowsePlaylistsDetail');
filterCols('colsBrowseFilesystem'); filterCols('colsBrowseFilesystem');
filterCols('colsBrowseDatabase'); filterCols('colsBrowseDatabase');
@ -1160,16 +1169,16 @@ function parseSettings(obj) {
document.getElementById('syscmds').innerHTML = ''; document.getElementById('syscmds').innerHTML = '';
dropdownMainMenu = new Dropdown(document.getElementById('mainMenu')); dropdownMainMenu = new Dropdown(document.getElementById('mainMenu'));
setCols('Queue'); setCols('QueueCurrent');
setCols('Search'); setCols('Search');
setCols('LastPlayed'); setCols('QueueLastPlayed');
setCols('BrowseFilesystem'); setCols('BrowseFilesystem');
setCols('BrowsePlaylistsDetail'); setCols('BrowsePlaylistsDetail');
setCols('BrowseDatabase', '.tblAlbumTitles'); setCols('BrowseDatabase', '.tblAlbumTitles');
setCols('Playback'); setCols('Playback');
if (app.current.app == 'Queue') if (app.current.app == 'Queue' && app.current.tab == 'Current')
getQueue(); getQueue();
else if (app.current.app == 'LastPlayed') else if (app.current.app == 'Queue' && app.current.tab == 'LastPlayed')
appRoute(); appRoute();
else if (app.current.app == 'Search') else if (app.current.app == 'Search')
appRoute(); appRoute();
@ -1187,11 +1196,11 @@ function setCols(table, className) {
if (settings.featTags == false) if (settings.featTags == false)
tags.push('Title'); tags.push('Title');
tags.push('Duration'); tags.push('Duration');
if (table == 'Queue' || table == 'BrowsePlaylistsDetail' || table == 'LastPlayed') if (table == 'QueueCurrent' || table == 'BrowsePlaylistsDetail' || table == 'QueueLastPlayed')
tags.push('Pos'); tags.push('Pos');
if (table == 'BrowseFilesystem') if (table == 'BrowseFilesystem')
tags.push('Type'); tags.push('Type');
if (table == 'LastPlayed') if (table == 'QueueLastPlayed')
tags.push('LastPlayed'); tags.push('LastPlayed');
tags.sort(); tags.sort();
@ -1455,26 +1464,19 @@ function getQueue() {
} }
function parseQueue(obj) { function parseQueue(obj) {
if (app.current.app !== 'Queue')
return;
if (typeof(obj.totalTime) != undefined && obj.totalTime > 0 && obj.totalEntities <= settings.maxElementsPerPage ) if (typeof(obj.totalTime) != undefined && obj.totalTime > 0 && obj.totalEntities <= settings.maxElementsPerPage )
document.getElementById('panel-heading-queue').innerText = obj.totalEntities + ' ' + (obj.totalEntities > 1 ? 'Songs' : 'Song') + ' ' + beautifyDuration(obj.totalTime); document.getElementById('QueueCurrentLength').innerText = obj.totalEntities + ' ' + (obj.totalEntities > 1 ? 'Songs' : 'Song') + ' ' + beautifyDuration(obj.totalTime);
else if (obj.totalEntities > 0) else if (obj.totalEntities > 0)
document.getElementById('panel-heading-queue').innerText = obj.totalEntities + ' ' + (obj.totalEntities > 1 ? 'Songs' : 'Song'); document.getElementById('QueueCurrentLength').innerText = obj.totalEntities + ' ' + (obj.totalEntities > 1 ? 'Songs' : 'Song');
else else
document.getElementById('panel-heading-queue').innerText = ''; document.getElementById('QueueCurrentLength').innerText = '';
var nrItems = obj.data.length; var nrItems = obj.data.length;
var table = document.getElementById(app.current.app + 'List'); var table = document.getElementById('QueueCurrentList');
table.setAttribute('data-version', obj.queueVersion); table.setAttribute('data-version', obj.queueVersion);
var tbody = table.getElementsByTagName('tbody')[0]; var tbody = table.getElementsByTagName('tbody')[0];
var tr = tbody.getElementsByTagName('tr'); var tr = tbody.getElementsByTagName('tr');
for (var i = 0; i < nrItems; i++) { for (var i = 0; i < nrItems; i++) {
//if (tr[i])
// if (tr[i].getAttribute('data-trackid') == obj.data[i].id && tr[i].getAttribute('data-songpos') == (obj.data[i].pos + 1))
// continue;
var minutes = Math.floor(obj.data[i].Duration / 60); var minutes = Math.floor(obj.data[i].Duration / 60);
var seconds = obj.data[i].Duration - minutes * 60; var seconds = obj.data[i].Duration - minutes * 60;
obj.data[i].Duration = minutes + ':' + (seconds < 10 ? '0' : '') + seconds; obj.data[i].Duration = minutes + ':' + (seconds < 10 ? '0' : '') + seconds;
@ -1486,8 +1488,8 @@ function parseQueue(obj) {
row.setAttribute('data-duration', obj.data[i].Duration); row.setAttribute('data-duration', obj.data[i].Duration);
row.setAttribute('data-uri', obj.data[i].uri); row.setAttribute('data-uri', obj.data[i].uri);
var tds = ''; var tds = '';
for (var c = 0; c < settings.colsQueue.length; c++) { for (var c = 0; c < settings.colsQueueCurrent.length; c++) {
tds += '<td data-col="' + settings.colsQueue[c] + '">' + obj.data[i][settings.colsQueue[c]] + '</td>'; tds += '<td data-col="' + settings.colsQueueCurrent[c] + '">' + obj.data[i][settings.colsQueueCurrent[c]] + '</td>';
} }
tds += '<td data-col="Action"><a href="#" class="material-icons color-darkgrey">playlist_add</a></td>'; tds += '<td data-col="Action"><a href="#" class="material-icons color-darkgrey">playlist_add</a></td>';
row.innerHTML = tds; row.innerHTML = tds;
@ -1501,7 +1503,7 @@ function parseQueue(obj) {
tr[i].remove(); tr[i].remove();
} }
var colspan = settings['cols' + app.current.app].length; var colspan = settings['colsQueueCurrent'].length;
colspan--; colspan--;
if (obj.type == 'queuesearch' && nrItems == 0) if (obj.type == 'queuesearch' && nrItems == 0)
@ -1512,17 +1514,13 @@ function parseQueue(obj) {
'<td colspan="' + colspan + '">Empty queue</td></tr>'; '<td colspan="' + colspan + '">Empty queue</td></tr>';
setPagination(obj.totalEntities); setPagination(obj.totalEntities);
document.getElementById('QueueList').classList.remove('opacity05'); document.getElementById('QueueCurrentList').classList.remove('opacity05');
} }
function parseLastPlayed(obj) { function parseLastPlayed(obj) {
if (app.current.app !== 'LastPlayed') document.getElementById('QueueLastPlayedLength').innerText = obj.totalEntities + ' Songs';
return;
document.getElementById('panel-heading-last-played').innerText = obj.totalEntities + ' Songs';
var nrItems = obj.data.length; var nrItems = obj.data.length;
var table = document.getElementById(app.current.app + 'List'); var table = document.getElementById('QueueLastPlayedList');
table.setAttribute('data-version', obj.queueVersion); table.setAttribute('data-version', obj.queueVersion);
var tbody = table.getElementsByTagName('tbody')[0]; var tbody = table.getElementsByTagName('tbody')[0];
var tr = tbody.getElementsByTagName('tr'); var tr = tbody.getElementsByTagName('tr');
@ -1535,8 +1533,8 @@ function parseLastPlayed(obj) {
row.setAttribute('data-songpos', (obj.data[i].Pos + 1)); row.setAttribute('data-songpos', (obj.data[i].Pos + 1));
row.setAttribute('data-uri', obj.data[i].uri); row.setAttribute('data-uri', obj.data[i].uri);
var tds = ''; var tds = '';
for (var c = 0; c < settings.colsLastPlayed.length; c++) { for (var c = 0; c < settings.colsQueueLastPlayed.length; c++) {
tds += '<td data-col="' + settings.colsLastPlayed[c] + '">' + obj.data[i][settings.colsLastPlayed[c]] + '</td>'; tds += '<td data-col="' + settings.colsQueueLastPlayed[c] + '">' + obj.data[i][settings.colsQueueLastPlayed[c]] + '</td>';
} }
tds += '<td data-col="Action"><a href="#" class="material-icons color-darkgrey">playlist_add</a></td>'; tds += '<td data-col="Action"><a href="#" class="material-icons color-darkgrey">playlist_add</a></td>';
row.innerHTML = tds; row.innerHTML = tds;
@ -1550,7 +1548,7 @@ function parseLastPlayed(obj) {
tr[i].remove(); tr[i].remove();
} }
var colspan = settings['cols' + app.current.app].length; var colspan = settings['colsQueueLastPlayed'].length;
colspan--; colspan--;
if (nrItems == 0) if (nrItems == 0)
@ -1558,7 +1556,7 @@ function parseLastPlayed(obj) {
'<td colspan="' + colspan + '">Empty list</td></tr>'; '<td colspan="' + colspan + '">Empty list</td></tr>';
setPagination(obj.totalEntities); setPagination(obj.totalEntities);
document.getElementById('LastPlayedList').classList.remove('opacity05'); document.getElementById('QueueLastPlayedList').classList.remove('opacity05');
} }
function parseSearch(obj) { function parseSearch(obj) {
@ -1577,8 +1575,6 @@ function parseSearch(obj) {
} }
function parseFilesystem(obj) { function parseFilesystem(obj) {
if (app.current.app !== 'Browse' && app.current.tab !== 'Filesystem' && app.current.app !== 'Search')
return;
var list = app.current.app + (app.current.tab == 'Filesystem' ? app.current.tab : ''); var list = app.current.app + (app.current.tab == 'Filesystem' ? app.current.tab : '');
var colspan = settings['cols' + list].length; var colspan = settings['cols' + list].length;
colspan--; colspan--;
@ -1647,12 +1643,10 @@ function parseFilesystem(obj) {
if (nrItems == 0) if (nrItems == 0)
tbody.innerHTML = '<tr><td><span class="material-icons">error_outline</span></td>' + tbody.innerHTML = '<tr><td><span class="material-icons">error_outline</span></td>' +
'<td colspan="' + colspan + '">No results</td></tr>'; '<td colspan="' + colspan + '">No results</td></tr>';
document.getElementById(app.current.app + (app.current.tab==undefined ? '' : app.current.tab) + 'List').classList.remove('opacity05'); document.getElementById(app.current.app + (app.current.tab == undefined ? '' : app.current.tab) + 'List').classList.remove('opacity05');
} }
function parsePlaylists(obj) { function parsePlaylists(obj) {
if (app.current.app !== 'Browse' && app.current.tab !== 'Playlists')
return;
if (app.current.view == 'All') { if (app.current.view == 'All') {
document.getElementById('BrowsePlaylistsAllList').classList.remove('hide'); document.getElementById('BrowsePlaylistsAllList').classList.remove('hide');
document.getElementById('BrowsePlaylistsDetailList').classList.add('hide'); document.getElementById('BrowsePlaylistsDetailList').classList.add('hide');
@ -2461,7 +2455,7 @@ function showMenu(el, event) {
addMenuItem({"cmd": "showAddToPlaylist", "options": [uri]}, 'Add to playlist') + addMenuItem({"cmd": "showAddToPlaylist", "options": [uri]}, 'Add to playlist') +
(uri.indexOf('http') == -1 ? addMenuItem({"cmd": "songDetails", "options": [uri]}, 'Songdetails') : ''); (uri.indexOf('http') == -1 ? addMenuItem({"cmd": "songDetails", "options": [uri]}, 'Songdetails') : '');
} }
else if (app.current.app == 'Queue') { else if (app.current.app == 'Queue' && app.current.tab == 'Current') {
menu += addMenuItem({"cmd": "delQueueSong", "options": ["single", el.parentNode.parentNode.getAttribute('data-trackid')]}, 'Remove') + menu += addMenuItem({"cmd": "delQueueSong", "options": ["single", el.parentNode.parentNode.getAttribute('data-trackid')]}, 'Remove') +
addMenuItem({"cmd": "delQueueSong", "options": ["range", 0, el.parentNode.parentNode.getAttribute('data-songpos')]}, 'Remove all upwards') + addMenuItem({"cmd": "delQueueSong", "options": ["range", 0, el.parentNode.parentNode.getAttribute('data-songpos')]}, 'Remove all upwards') +
addMenuItem({"cmd": "delQueueSong", "options": ["range", (parseInt(el.parentNode.parentNode.getAttribute('data-songpos'))-1), -1]}, 'Remove all downwards') + addMenuItem({"cmd": "delQueueSong", "options": ["range", (parseInt(el.parentNode.parentNode.getAttribute('data-songpos'))-1), -1]}, 'Remove all downwards') +

View File

@ -118,9 +118,9 @@ void callback_mympd(struct mg_connection *nc, const struct mg_str msg) {
int len = strlen(cols); int len = strlen(cols);
if (len > 1) if (len > 1)
cols[len - 2] = '\0'; cols[len - 2] = '\0';
if (strcmp(p_charbuf1,"colsQueue")==0) { if (strcmp(p_charbuf1,"colsQueueCurrent")==0) {
free(mympd_state.colsQueue); free(mympd_state.colsQueueCurrent);
mympd_state.colsQueue = strdup(cols); mympd_state.colsQueueCurrent = strdup(cols);
} }
else if (strcmp(p_charbuf1,"colsSearch")==0) { else if (strcmp(p_charbuf1,"colsSearch")==0) {
free(mympd_state.colsSearch); free(mympd_state.colsSearch);
@ -142,9 +142,9 @@ void callback_mympd(struct mg_connection *nc, const struct mg_str msg) {
free(mympd_state.colsPlayback); free(mympd_state.colsPlayback);
mympd_state.colsPlayback = strdup(cols); mympd_state.colsPlayback = strdup(cols);
} }
else if (strcmp(p_charbuf1,"colsLastPlayed")==0) { else if (strcmp(p_charbuf1,"colsQueueLastPlayed")==0) {
free(mympd_state.colsLastPlayed); free(mympd_state.colsQueueLastPlayed);
mympd_state.colsLastPlayed = strdup(cols); mympd_state.colsQueueLastPlayed = strdup(cols);
} }
mympd_state_set(p_charbuf1, cols); mympd_state_set(p_charbuf1, cols);
free(p_charbuf1); free(p_charbuf1);
@ -1488,15 +1488,15 @@ int mympd_put_settings(char *buffer) {
} }
len += json_printf(&out, "]"); len += json_printf(&out, "]");
} }
len += json_printf(&out, ", colsQueue: %s, colsSearch: %s, colsBrowseDatabase: %s, colsBrowsePlaylistsDetail: %s, " len += json_printf(&out, ", colsQueueCurrent: %s, colsSearch: %s, colsBrowseDatabase: %s, colsBrowsePlaylistsDetail: %s, "
"colsBrowseFilesystem: %s, colsPlayback: %s, colsLastPlayed: %s}}", "colsBrowseFilesystem: %s, colsPlayback: %s, colsQueueLastPlayed: %s}}",
mympd_state.colsQueue, mympd_state.colsQueueCurrent,
mympd_state.colsSearch, mympd_state.colsSearch,
mympd_state.colsBrowseDatabase, mympd_state.colsBrowseDatabase,
mympd_state.colsBrowsePlaylistsDetail, mympd_state.colsBrowsePlaylistsDetail,
mympd_state.colsBrowseFilesystem, mympd_state.colsBrowseFilesystem,
mympd_state.colsPlayback, mympd_state.colsPlayback,
mympd_state.colsLastPlayed mympd_state.colsQueueLastPlayed
); );
CHECK_RETURN_LEN(); CHECK_RETURN_LEN();

View File

@ -219,13 +219,13 @@ typedef struct {
int jukeboxMode; int jukeboxMode;
const char *jukeboxPlaylist; const char *jukeboxPlaylist;
int jukeboxQueueLength; int jukeboxQueueLength;
char *colsQueue; char *colsQueueCurrent;
char *colsSearch; char *colsSearch;
char *colsBrowseDatabase; char *colsBrowseDatabase;
char *colsBrowsePlaylistsDetail; char *colsBrowsePlaylistsDetail;
char *colsBrowseFilesystem; char *colsBrowseFilesystem;
char *colsPlayback; char *colsPlayback;
char *colsLastPlayed; char *colsQueueLastPlayed;
} t_mympd_state; } t_mympd_state;
t_mympd_state mympd_state; t_mympd_state mympd_state;

View File

@ -279,11 +279,11 @@ void read_statefiles() {
mympd_state_set("jukeboxQueueLength", "1"); mympd_state_set("jukeboxQueueLength", "1");
} }
if (mympd_state_get("colsQueue", value)) if (mympd_state_get("colsQueueCurrent", value))
mympd_state.colsQueue = strdup(value); mympd_state.colsQueueCurrent = strdup(value);
else { else {
mympd_state.colsQueue = strdup("[\"Pos\",\"Title\",\"Artist\",\"Album\",\"Duration\"]"); mympd_state.colsQueueCurrent = strdup("[\"Pos\",\"Title\",\"Artist\",\"Album\",\"Duration\"]");
mympd_state_set("colsQueue", mympd_state.colsQueue); mympd_state_set("colsQueueCurrent", mympd_state.colsQueueCurrent);
} }
if (mympd_state_get("colsSearch", value)) if (mympd_state_get("colsSearch", value))
@ -321,11 +321,11 @@ void read_statefiles() {
mympd_state_set("colsPlayback", mympd_state.colsPlayback); mympd_state_set("colsPlayback", mympd_state.colsPlayback);
} }
if (mympd_state_get("colsLastPlayed", value)) if (mympd_state_get("colsQueueLastPlayed", value))
mympd_state.colsLastPlayed = strdup(value); mympd_state.colsQueueLastPlayed = strdup(value);
else { else {
mympd_state.colsLastPlayed = strdup("[\"Pos\",\"Title\",\"Artist\",\"Album\",\"LastPlayed\"]"); mympd_state.colsQueueLastPlayed = strdup("[\"Pos\",\"Title\",\"Artist\",\"Album\",\"LastPlayed\"]");
mympd_state_set("colsLastPlayed", mympd_state.colsLastPlayed); mympd_state_set("colsQueueLastPlayed", mympd_state.colsQueueLastPlayed);
} }
} }