mirror of
https://github.com/SuperBFG7/ympd
synced 2025-02-05 05:30:10 +00:00
Added filtering of playlists and database, issue #8
This commit is contained in:
parent
fb96a48d1d
commit
abedf01628
@ -180,7 +180,10 @@ main {
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
#browseFilesystemFilterLetters > button {
|
||||
#browseFilesystemFilterLetters > button,
|
||||
#browseDatabaseFilterLetters > button,
|
||||
#browsePlaylistsFilterLetters > button
|
||||
{
|
||||
min-width:28px;
|
||||
}
|
||||
|
||||
|
@ -206,16 +206,21 @@
|
||||
<a class="nav-link text-dark" href="#/browse/filesystem/0/!/" id="cardBrowseNavFilesystem">Filesystem</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" href="#/browse/playlists/0" id="cardBrowseNavPlaylists">Playlists</a>
|
||||
<a class="nav-link text-dark" href="#/browse/playlists/0/!/" id="cardBrowseNavPlaylists">Playlists</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" href="#/browse/database/0/" id="cardBrowseNavDatabase">Database</a>
|
||||
<a class="nav-link text-dark" href="#/browse/database/0/!/" id="cardBrowseNavDatabase">Database</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card-body hide" id="cardBrowsePlaylists">
|
||||
<div class="btn-toolbar collapse show" id="browsePlaylistsButtons" role="toolbar">
|
||||
<div class="btn-group mr-2">
|
||||
<button id="browsePlaylistsFilter" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Filter</button>
|
||||
<div class="dropdown-menu bg-dark px-2" id="browsePlaylistsFilterLetters">
|
||||
</div>
|
||||
</div>
|
||||
<div id="browsePlaylistsPaginationTop" class="btn-group mr-2">
|
||||
<button onclick="gotoPage('prev',this,event)" id="browsePlaylistsPaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button>
|
||||
<div class="input-group-append">
|
||||
@ -267,7 +272,12 @@
|
||||
|
||||
<div class="btn-toolbar collapse show" id="browseDatabaseButtons" role="toolbar">
|
||||
<div class="btn-group mr-2">
|
||||
<button id="btnBrowseDatabaseArtist" onclick="app.setLocation('#/browse/database/0/');" type="button" class="btn btn-secondary hide">« Artists</button>
|
||||
<button id="btnBrowseDatabaseArtist" onclick="app.setLocation('#/browse/database/0/!/');" type="button" class="btn btn-secondary hide">« Artists</button>
|
||||
</div>
|
||||
<div class="btn-group mr-2">
|
||||
<button id="browseDatabaseFilter" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Filter</button>
|
||||
<div class="dropdown-menu bg-dark px-2" id="browseDatabaseFilterLetters">
|
||||
</div>
|
||||
</div>
|
||||
<div id="browseDatabasePaginationTop" class="btn-group mr-2">
|
||||
<button onclick="gotoPage('prev',this,event)" id="browseDatabasePaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button>
|
||||
|
@ -93,32 +93,35 @@ var app = $.sammy(function() {
|
||||
}
|
||||
});
|
||||
|
||||
this.get(/\#\/browse\/playlists\/(\d+)/, function() {
|
||||
this.get(/\#\/browse\/playlists\/(\d+)\/(\w|\!)/, function() {
|
||||
prepare();
|
||||
browsepath = this.params['splat'][1];
|
||||
pagination = parseInt(this.params['splat'][0]);
|
||||
filterLetter = this.params['splat'][1];
|
||||
current_app = 'browsePlaylists';
|
||||
$('#navBrowse').addClass('active');
|
||||
$('#cardBrowse').removeClass('hide');
|
||||
$('#cardBrowsePlaylists').removeClass('hide');
|
||||
$('#cardBrowseNavPlaylists').addClass('active');
|
||||
socket.send('MPD_API_GET_PLAYLISTS,'+pagination);
|
||||
socket.send('MPD_API_GET_PLAYLISTS,'+pagination+','+filterLetter);
|
||||
doSetFilterLetter('#browsePlaylistsFilter');
|
||||
});
|
||||
|
||||
this.get(/\#\/browse\/database\/(\d+)\/(.*)/, function() {
|
||||
this.get(/\#\/browse\/database\/(\d+)\/(\w|\!)\/(.*)/, function() {
|
||||
prepare();
|
||||
pagination = parseInt(this.params['splat'][0]);
|
||||
artist = this.params['splat'][1];
|
||||
filterLetter = this.params['splat'][1];
|
||||
artist = this.params['splat'][2];
|
||||
current_app = 'browseDatabase';
|
||||
$('#navBrowse').addClass('active');
|
||||
$('#cardBrowse').removeClass('hide');
|
||||
$('#cardBrowseDatabase').removeClass('hide');
|
||||
$('#cardBrowseNavDatabase').addClass('active');
|
||||
if (artist == "") {
|
||||
socket.send('MPD_API_GET_ARTISTS,'+pagination);
|
||||
socket.send('MPD_API_GET_ARTISTS,' + pagination + ',' + filterLetter);
|
||||
} else {
|
||||
socket.send('MPD_API_GET_ARTISTALBUMS,'+pagination+',' + decodeURI(artist));
|
||||
socket.send('MPD_API_GET_ARTISTALBUMS,' + pagination+',' + filterLetter + ',' + decodeURI(artist));
|
||||
}
|
||||
doSetFilterLetter('#browseDatabaseFilter');
|
||||
});
|
||||
|
||||
this.get(/\#\/browse\/filesystem\/(\d+)\/(\w|\!)\/(.*)/, function() {
|
||||
@ -133,24 +136,7 @@ var app = $.sammy(function() {
|
||||
$('#cardBrowseNavFilesystem').addClass('active');
|
||||
$('#browseBreadcrumb').empty().append("<li class=\"breadcrumb-item\"><a uri=\"\">root</a></li>");
|
||||
socket.send('MPD_API_GET_BROWSE,'+pagination+','+(browsepath ? browsepath : "/")+','+filterLetter);
|
||||
$('#browseFilesystemFilterLetters > button').removeClass('btn-success').addClass('btn-secondary');
|
||||
if (filterLetter == '0') {
|
||||
$('#browseFilesystemFilter').text('Filter: #');
|
||||
$('#browseFilesystemFilterLetters > button').each(function() {
|
||||
if ($(this).text() == '#') {
|
||||
$(this).addClass('btn-success');
|
||||
}
|
||||
});
|
||||
} else if (filterLetter != '!') {
|
||||
$('#browseFilesystemFilter').text('Filter: '+filterLetter);
|
||||
$('#browseFilesystemFilterLetters > button').each(function() {
|
||||
if ($(this).text() == filterLetter) {
|
||||
$(this).addClass('btn-success');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#browseFilesystemFilter').text('Filter');
|
||||
}
|
||||
doSetFilterLetter('#browseFilesystemFilter');
|
||||
// Don't add all songs from root
|
||||
var add_all_songs = $('#browseFilesystemAddAllSongs');
|
||||
if (browsepath) {
|
||||
@ -268,7 +254,9 @@ $(document).ready(function(){
|
||||
if (Cookies.get('notificationPage') === 'true')
|
||||
$('#btnnotifyPage').removeClass('btn-secondary').addClass("btn-success")
|
||||
|
||||
add_filter();
|
||||
add_filter('#browseFilesystemFilterLetters');
|
||||
add_filter('#browseDatabaseFilterLetters');
|
||||
add_filter('#browsePlaylistsFilterLetters');
|
||||
});
|
||||
|
||||
function webSocketConnect() {
|
||||
@ -462,7 +450,7 @@ function webSocketConnect() {
|
||||
$('#'+current_app+'List > tbody > tr').on({
|
||||
click: function() {
|
||||
pagination = 0;
|
||||
app.setLocation('#/browse/database/'+pagination+'/'+$(this).attr('uri'));
|
||||
app.setLocation('#/browse/database/'+pagination+'/!/'+$(this).attr('uri'));
|
||||
}
|
||||
});
|
||||
if (nrItems == 0) {
|
||||
@ -1169,10 +1157,10 @@ function gotoPage(x,element,event) {
|
||||
app.setLocation('#/browse/filesystem/'+pagination+'/'+filterLetter+'/'+browsepath);
|
||||
break;
|
||||
case "browsePlaylists":
|
||||
app.setLocation('#/browse/playlists/'+pagination);
|
||||
app.setLocation('#/browse/playlists/'+pagination+'/'+filterLetter);
|
||||
break;
|
||||
case "browseDatabase":
|
||||
app.setLocation('#/browse/database/'+pagination+'/'+artist);
|
||||
app.setLocation('#/browse/database/'+pagination+'/'+filterLetter+'/'+artist);
|
||||
break;
|
||||
}
|
||||
event.preventDefault();
|
||||
@ -1282,16 +1270,47 @@ $(document).keydown(function(e){
|
||||
|
||||
function setFilterLetter(filter) {
|
||||
pagination = 0;
|
||||
app.setLocation('#/browse/filesystem/'+pagination+'/'+filter+'/'+browsepath);
|
||||
switch(current_app) {
|
||||
case 'browseFilesystem':
|
||||
app.setLocation('#/browse/filesystem/'+pagination+'/'+filter+'/'+browsepath);
|
||||
break;
|
||||
case 'browseDatabase':
|
||||
app.setLocation('#/browse/database/'+pagination+'/'+filter+'/'+artist);
|
||||
break;
|
||||
case 'browsePlaylists':
|
||||
app.setLocation('#/browse/playlists/'+pagination+'/'+filter+'/'+artist);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function add_filter () {
|
||||
$('#browseFilesystemFilterLetters').append('<button class="mr-1 mb-1 btn btn-sm btn-secondary" onclick="setFilterLetter(\'!\');">'+
|
||||
function doSetFilterLetter(x) {
|
||||
$(x+'Letters > button').removeClass('btn-success').addClass('btn-secondary');
|
||||
if (filterLetter == '0') {
|
||||
$(x).text('Filter: #');
|
||||
$(x+'Letters > button').each(function() {
|
||||
if ($(this).text() == '#') {
|
||||
$(this).addClass('btn-success');
|
||||
}
|
||||
});
|
||||
} else if (filterLetter != '!') {
|
||||
$(x).text('Filter: '+filterLetter);
|
||||
$(x+'Letters > button').each(function() {
|
||||
if ($(this).text() == filterLetter) {
|
||||
$(this).addClass('btn-success');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$(x).text('Filter');
|
||||
}
|
||||
}
|
||||
|
||||
function add_filter (x) {
|
||||
$(x).append('<button class="mr-1 mb-1 btn btn-sm btn-secondary" onclick="setFilterLetter(\'!\');">'+
|
||||
'<span class="material-icons" style="font-size:14px;">delete</span></button>');
|
||||
$('#browseFilesystemFilterLetters').append('<button class="mr-1 mb-1 btn btn-sm btn-secondary" onclick="setFilterLetter(\'0\');">#</button>');
|
||||
$(x).append('<button class="mr-1 mb-1 btn btn-sm btn-secondary" onclick="setFilterLetter(\'0\');">#</button>');
|
||||
for (i = 65; i <= 90; i++) {
|
||||
var c = String.fromCharCode(i);
|
||||
$('#browseFilesystemFilterLetters').append('<button class="mr-1 mb-1 btn-sm btn btn-secondary" onclick="setFilterLetter(\'' + c + '\');">' + c + '</button>');
|
||||
$(x).append('<button class="mr-1 mb-1 btn-sm btn btn-secondary" onclick="setFilterLetter(\'' + c + '\');">' + c + '</button>');
|
||||
}
|
||||
}
|
||||
|
||||
|
134
src/mpd_client.c
134
src/mpd_client.c
@ -172,8 +172,20 @@ int callback_mpd(struct mg_connection *c)
|
||||
n = mpd_put_queue(mpd.buf, uint_buf);
|
||||
break;
|
||||
case MPD_API_GET_ARTISTS:
|
||||
if(sscanf(c->content, "MPD_API_GET_ARTISTS,%u", &uint_buf))
|
||||
n = mympd_put_db_tag(mpd.buf, uint_buf, "AlbumArtist","","");
|
||||
p_charbuf = strdup(c->content);
|
||||
if(strcmp(strtok(p_charbuf, ","), "MPD_API_GET_ARTISTS"))
|
||||
goto out_artist;
|
||||
uint_buf = strtoul(strtok(NULL, ","), NULL, 10);
|
||||
|
||||
if((token = strtok(NULL, ",")) == NULL) {
|
||||
goto out_artist;
|
||||
} else {
|
||||
p_charbuf2 = strdup(token);
|
||||
}
|
||||
n = mympd_put_db_tag(mpd.buf, uint_buf, "AlbumArtist","","",p_charbuf2);
|
||||
free(p_charbuf2);
|
||||
out_artist:
|
||||
free(p_charbuf);
|
||||
break;
|
||||
case MPD_API_GET_ARTISTALBUMS:
|
||||
p_charbuf = strdup(c->content);
|
||||
@ -183,13 +195,21 @@ int callback_mpd(struct mg_connection *c)
|
||||
|
||||
if((token = strtok(NULL, ",")) == NULL) {
|
||||
goto out_artistalbum;
|
||||
} else {
|
||||
p_charbuf2 = strdup(token);
|
||||
}
|
||||
|
||||
if((token = strtok(NULL, ",")) == NULL) {
|
||||
free(p_charbuf2);
|
||||
goto out_artistalbum;
|
||||
} else {
|
||||
searchstr = strdup(token);
|
||||
}
|
||||
n = mympd_put_db_tag(mpd.buf, uint_buf, "Album", "AlbumArtist", searchstr);
|
||||
n = mympd_put_db_tag(mpd.buf, uint_buf, "Album", "AlbumArtist", searchstr, p_charbuf2);
|
||||
free(searchstr);
|
||||
free(p_charbuf2);
|
||||
out_artistalbum:
|
||||
free(p_charbuf);
|
||||
free(p_charbuf);
|
||||
break;
|
||||
case MPD_API_GET_ARTISTALBUMTITLES:
|
||||
p_charbuf = strdup(c->content);
|
||||
@ -201,20 +221,26 @@ out_artistalbum:
|
||||
} else {
|
||||
searchstr = strdup(token);
|
||||
}
|
||||
/* if((token = strtok(NULL, ",")) == NULL) {
|
||||
goto out_artistalbumtitle;
|
||||
} else {
|
||||
p_charbuf2 = strdup(token);
|
||||
}
|
||||
*/
|
||||
n = mympd_put_songs_in_album(mpd.buf, searchstr, token+strlen(token)+1);
|
||||
free(searchstr);
|
||||
out_artistalbumtitle:
|
||||
free(p_charbuf);
|
||||
break;
|
||||
case MPD_API_GET_PLAYLISTS:
|
||||
if(sscanf(c->content, "MPD_API_GET_PLAYLISTS,%u", &uint_buf))
|
||||
n = mpd_put_playlists(mpd.buf, uint_buf);
|
||||
p_charbuf = strdup(c->content);
|
||||
if(strcmp(strtok(p_charbuf, ","), "MPD_API_GET_PLAYLISTS"))
|
||||
goto out_artist;
|
||||
uint_buf = strtoul(strtok(NULL, ","), NULL, 10);
|
||||
|
||||
if((token = strtok(NULL, ",")) == NULL) {
|
||||
goto out_playlists;
|
||||
} else {
|
||||
p_charbuf2 = strdup(token);
|
||||
}
|
||||
n = mympd_put_playlists(mpd.buf, uint_buf, p_charbuf2);
|
||||
free(p_charbuf2);
|
||||
out_playlists:
|
||||
free(p_charbuf);
|
||||
break;
|
||||
case MPD_API_GET_BROWSE:
|
||||
p_charbuf = strdup(c->content);
|
||||
@ -971,12 +997,14 @@ int mpd_put_browse(char *buffer, char *path, unsigned int offset, char *filter)
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"offset\":");
|
||||
cur += json_emit_int(cur, end - cur, offset);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"returnedEntities\":");
|
||||
cur += json_emit_int(cur, end - cur, entities_returned);
|
||||
cur += json_emit_int(cur, end - cur, entities_returned);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"filter\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, filter);
|
||||
cur += json_emit_raw_str(cur, end - cur, "}");
|
||||
return cur - buffer;
|
||||
}
|
||||
|
||||
int mympd_put_db_tag(char *buffer, unsigned int offset, char *mpdtagtype, char *mpdsearchtagtype, char *searchstr)
|
||||
int mympd_put_db_tag(char *buffer, unsigned int offset, char *mpdtagtype, char *mpdsearchtagtype, char *searchstr, char *filter)
|
||||
{
|
||||
char *cur = buffer;
|
||||
const char *end = buffer + MAX_SIZE;
|
||||
@ -994,39 +1022,47 @@ int mympd_put_db_tag(char *buffer, unsigned int offset, char *mpdtagtype, char *
|
||||
|
||||
if(mpd_search_commit(mpd.conn) == false)
|
||||
RETURN_ERROR_AND_RECOVER("mpd_search_commit");
|
||||
else {
|
||||
cur += json_emit_raw_str(cur, end - cur, "{\"type\":\"listDBtags\",\"data\":[ ");
|
||||
while((pair = mpd_recv_pair_tag(mpd.conn, mpd_tag_name_parse(mpdtagtype))) != NULL) {
|
||||
entity_count ++;
|
||||
if(entity_count > offset && entity_count <= offset+MAX_ELEMENTS_PER_PAGE) {
|
||||
|
||||
cur += json_emit_raw_str(cur, end - cur, "{\"type\":\"listDBtags\",\"data\":[ ");
|
||||
while((pair = mpd_recv_pair_tag(mpd.conn, mpd_tag_name_parse(mpdtagtype))) != NULL) {
|
||||
entity_count ++;
|
||||
if(entity_count > offset && entity_count <= offset+MAX_ELEMENTS_PER_PAGE) {
|
||||
if (strncmp(filter,"!",1) == 0 || strncasecmp(filter,pair->value,1) == 0 ||
|
||||
( strncmp(filter,"0",1) == 0 && isalpha(*pair->value) == 0 )
|
||||
) {
|
||||
entities_returned ++;
|
||||
cur += json_emit_raw_str(cur, end - cur, "{\"type\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, mpdtagtype);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"value\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, pair->value);
|
||||
cur += json_emit_raw_str(cur, end - cur, "},");
|
||||
} else {
|
||||
entity_count --;
|
||||
}
|
||||
mpd_return_pair(mpd.conn, pair);
|
||||
}
|
||||
|
||||
/* remove last ',' */
|
||||
cur--;
|
||||
|
||||
cur += json_emit_raw_str(cur, end - cur, "]");
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"totalEntities\":");
|
||||
cur += json_emit_int(cur, end - cur, entity_count);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"offset\":");
|
||||
cur += json_emit_int(cur, end - cur, offset);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"returnedEntities\":");
|
||||
cur += json_emit_int(cur, end - cur, entities_returned);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"tagtype\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, mpdtagtype);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"searchtagtype\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, mpdsearchtagtype);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"searchstr\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, searchstr);
|
||||
cur += json_emit_raw_str(cur, end - cur, "}");
|
||||
mpd_return_pair(mpd.conn, pair);
|
||||
}
|
||||
|
||||
/* remove last ',' */
|
||||
cur--;
|
||||
|
||||
cur += json_emit_raw_str(cur, end - cur, "]");
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"totalEntities\":");
|
||||
cur += json_emit_int(cur, end - cur, entity_count);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"offset\":");
|
||||
cur += json_emit_int(cur, end - cur, offset);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"returnedEntities\":");
|
||||
cur += json_emit_int(cur, end - cur, entities_returned);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"tagtype\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, mpdtagtype);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"searchtagtype\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, mpdsearchtagtype);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"searchstr\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, searchstr);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"filter\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, filter);
|
||||
cur += json_emit_raw_str(cur, end - cur, "}");
|
||||
|
||||
return cur - buffer;
|
||||
}
|
||||
|
||||
@ -1088,13 +1124,14 @@ int mympd_put_songs_in_album(char *buffer, char *albumartist, char *album)
|
||||
return cur - buffer;
|
||||
}
|
||||
|
||||
int mpd_put_playlists(char *buffer, unsigned int offset)
|
||||
int mympd_put_playlists(char *buffer, unsigned int offset, char *filter)
|
||||
{
|
||||
char *cur = buffer;
|
||||
const char *end = buffer + MAX_SIZE;
|
||||
struct mpd_playlist *pl;
|
||||
unsigned int entity_count = 0;
|
||||
unsigned int entities_returned = 0;
|
||||
const char *plpath;
|
||||
|
||||
if (!mpd_send_list_playlists(mpd.conn))
|
||||
RETURN_ERROR_AND_RECOVER("mpd_send_lists_playlists");
|
||||
@ -1104,12 +1141,19 @@ int mpd_put_playlists(char *buffer, unsigned int offset)
|
||||
while((pl = mpd_recv_playlist(mpd.conn)) != NULL) {
|
||||
entity_count ++;
|
||||
if(entity_count > offset && entity_count <= offset+MAX_ELEMENTS_PER_PAGE) {
|
||||
entities_returned ++;
|
||||
cur += json_emit_raw_str(cur, end - cur, "{\"type\":\"playlist\",\"plist\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, mpd_playlist_get_path(pl));
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"last_modified\":");
|
||||
cur += json_emit_int(cur, end - cur, mpd_playlist_get_last_modified(pl));
|
||||
cur += json_emit_raw_str(cur, end - cur, "},");
|
||||
plpath = mpd_playlist_get_path(pl);
|
||||
if (strncmp(filter,"!",1) == 0 || strncasecmp(filter,plpath,1) == 0 ||
|
||||
( strncmp(filter,"0",1) == 0 && isalpha(*plpath) == 0 )
|
||||
) {
|
||||
entities_returned ++;
|
||||
cur += json_emit_raw_str(cur, end - cur, "{\"type\":\"playlist\",\"plist\":");
|
||||
cur += json_emit_quoted_str(cur, end - cur, plpath);
|
||||
cur += json_emit_raw_str(cur, end - cur, ",\"last_modified\":");
|
||||
cur += json_emit_int(cur, end - cur, mpd_playlist_get_last_modified(pl));
|
||||
cur += json_emit_raw_str(cur, end - cur, "},");
|
||||
} else {
|
||||
entity_count --;
|
||||
}
|
||||
}
|
||||
mpd_playlist_free(pl);
|
||||
}
|
||||
|
@ -132,15 +132,15 @@ int mpd_put_state(char *buffer, int *current_song_id, int *next_song_id, unsigne
|
||||
int mpd_put_outputs(char *buffer, int putnames);
|
||||
int mpd_put_current_song(char *buffer);
|
||||
int mpd_put_queue(char *buffer, unsigned int offset);
|
||||
int mpd_put_playlists(char *buffer, unsigned int offset);
|
||||
int mpd_put_browse(char *buffer, char *path, unsigned int offset, char *filter);
|
||||
int mpd_search(char *buffer, char *mpdtagtype, unsigned int offset, char *searchstr);
|
||||
int mpd_search_add(char *buffer, char *mpdtagtype, char *searchstr);
|
||||
int mpd_search_queue(char *buffer, char *mpdtagtype, unsigned int offset, char *searchstr);
|
||||
int mympd_get_stats(char *buffer);
|
||||
int mympd_put_settings(char *buffer);
|
||||
int mympd_put_db_tag(char *buffer, unsigned int offset, char *mpdtagtype, char *mpdsearchtagtype, char *searchstr);
|
||||
int mympd_put_db_tag(char *buffer, unsigned int offset, char *mpdtagtype, char *mpdsearchtagtype, char *searchstr, char *filter);
|
||||
int mympd_put_songs_in_album(char *buffer, char *albumartist, char *album);
|
||||
int mympd_put_playlists(char *buffer, unsigned int offset, char *filter);
|
||||
void mpd_disconnect();
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user