From 71868bf89d94b99c316296d6e43d1fa2b51bd361 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Sun, 29 Apr 2018 21:36:11 +0100 Subject: [PATCH] MAX_ELEMENTS_PER_PAGE=100 --- htdocs/js/mpd.js | 3 +-- src/mpd_client.c | 22 ++-------------------- src/mpd_client.h | 2 +- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js index 6d67bee..d38543f 100644 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@ -26,7 +26,7 @@ var pagination = 0; var browsepath; var lastSongTitle = ""; var current_song = new Object(); -var MAX_ELEMENTS_PER_PAGE = 512; +var MAX_ELEMENTS_PER_PAGE = 100; var dirble_selected_cat = ""; var dirble_catid = ""; var dirble_page = 1; @@ -289,7 +289,6 @@ function webSocketConnect() { socket.onmessage = function got_packet(msg) { if(msg.data === last_state || msg.data.length == 0) return; - var obj = JSON.parse(msg.data); diff --git a/src/mpd_client.c b/src/mpd_client.c index 24b2524..fd546f6 100644 --- a/src/mpd_client.c +++ b/src/mpd_client.c @@ -607,26 +607,8 @@ int mpd_put_current_song(char *buffer) cur += json_emit_int(cur, end - cur, mpd_song_get_pos(song)); cur += json_emit_raw_str(cur, end - cur, ",\"title\":"); cur += json_emit_quoted_str(cur, end - cur, mpd_get_title(song)); - - - if(mpd_song_get_tag(song, MPD_TAG_ARTIST, 0) != NULL) - { - cur += json_emit_raw_str(cur, end - cur, ",\"artist\":"); - cur += json_emit_quoted_str(cur, end - cur, mpd_song_get_tag(song, MPD_TAG_ARTIST, 0)); - } - - if(mpd_song_get_tag(song, MPD_TAG_ALBUM_ARTIST, 0) != NULL) - { - cur += json_emit_raw_str(cur, end - cur, ",\"album_artist\":"); - cur += json_emit_quoted_str(cur, end - cur, mpd_song_get_tag(song, MPD_TAG_ALBUM_ARTIST, 0)); - } - - if(mpd_song_get_tag(song, MPD_TAG_ALBUM, 0) != NULL) - { - cur += json_emit_raw_str(cur, end - cur, ",\"album\":"); - cur += json_emit_quoted_str(cur, end - cur, mpd_song_get_tag(song, MPD_TAG_ALBUM, 0)); - } - + cur += json_emit_raw_str(cur, end - cur, ",\"album_artist\":"); + cur += json_emit_quoted_str(cur, end - cur, mpd_get_album_artist(song)); cur += json_emit_raw_str(cur, end - cur, ",\"artist\":"); cur += json_emit_quoted_str(cur, end - cur, mpd_get_artist(song)); cur += json_emit_raw_str(cur, end - cur, ",\"album\":"); diff --git a/src/mpd_client.h b/src/mpd_client.h index 7598aa4..19e7917 100644 --- a/src/mpd_client.h +++ b/src/mpd_client.h @@ -32,7 +32,7 @@ #define MAX_SIZE 1024 * 100 -#define MAX_ELEMENTS_PER_PAGE 512 +#define MAX_ELEMENTS_PER_PAGE 100 #define GEN_ENUM(X) X, #define GEN_STR(X) #X,