mirror of
https://github.com/SuperBFG7/ympd
synced 2025-11-30 03:55:12 +00:00
Configurable coverimage filename
This commit is contained in:
@@ -299,8 +299,9 @@ out_send_message:
|
||||
break;
|
||||
case MPD_API_GET_OPTIONS:
|
||||
n = snprintf(mpd.buf, MAX_SIZE, "{\"type\":\"mpdoptions\", \"data\": "
|
||||
"{\"mpdhost\" : \"%s\", \"mpdport\": \"%d\", \"passwort_set\": %s, \"streamport\": \"%d\"}"
|
||||
"}", mpd.host, mpd.port, mpd.password ? "true" : "false", streamport);
|
||||
"{\"mpdhost\" : \"%s\", \"mpdport\": \"%d\", \"passwort_set\": %s, "
|
||||
"\"streamport\": \"%d\",\"coverimage\": \"%s\"}"
|
||||
"}", mpd.host, mpd.port, mpd.password ? "true" : "false", streamport, coverimage);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,10 +89,10 @@ enum mpd_conn_states {
|
||||
|
||||
struct t_mpd {
|
||||
int port;
|
||||
int local_port;
|
||||
int local_port;
|
||||
char host[128];
|
||||
char *password;
|
||||
char *gpass;
|
||||
char *gpass;
|
||||
|
||||
struct mpd_connection *conn;
|
||||
enum mpd_conn_states conn_state;
|
||||
@@ -106,6 +106,7 @@ struct t_mpd {
|
||||
} mpd;
|
||||
|
||||
int streamport;
|
||||
char coverimage[40];
|
||||
|
||||
struct t_mpd_client_session {
|
||||
int song_id;
|
||||
@@ -121,7 +122,7 @@ int mpd_put_current_song(char *buffer);
|
||||
int mpd_put_queue(char *buffer, unsigned int offset);
|
||||
int mpd_put_browse(char *buffer, char *path, unsigned int offset);
|
||||
int mpd_search(char *buffer, char *searchstr);
|
||||
int mpd_search_queue(char *buffer, char *mp3tag, char *searchstr);
|
||||
int mpd_search_queue(char *buffer, char *mpdtagtype, char *searchstr);
|
||||
void mpd_disconnect();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ int main(int argc, char **argv)
|
||||
mpd.gpass = NULL;
|
||||
strcpy(mpd.host, "127.0.0.1");
|
||||
streamport = 8000;
|
||||
strcpy(coverimage, "folder.jpg");
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"digest", required_argument, 0, 'D'},
|
||||
@@ -107,10 +108,11 @@ int main(int argc, char **argv)
|
||||
{"help", no_argument, 0, 0 },
|
||||
{"mpdpass", required_argument, 0, 'm'},
|
||||
{"streamport", required_argument, 0, 's'},
|
||||
{"coverimage", required_argument, 0, 'i'},
|
||||
{0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
while((n = getopt_long(argc, argv, "D:h:p:l:w:u:d:v:m:s",
|
||||
while((n = getopt_long(argc, argv, "D:h:p:l:w:u:d:v:m:s:i:",
|
||||
long_options, &option_index)) != -1) {
|
||||
switch (n) {
|
||||
case 'D':
|
||||
@@ -138,6 +140,9 @@ int main(int argc, char **argv)
|
||||
case 's':
|
||||
streamport = atoi(optarg);
|
||||
break;
|
||||
case 'i':
|
||||
strncpy(coverimage, optarg, sizeof(coverimage));
|
||||
break;
|
||||
case 'v':
|
||||
fprintf(stdout, "myMPD %d.%d.%d\n"
|
||||
"Copyright (C) 2018 Juergen Mang <mail@jcgames.de>\n"
|
||||
@@ -157,6 +162,7 @@ int main(int argc, char **argv)
|
||||
" -v, --version\t\t\tget version\n"
|
||||
" -m, --mpdpass <password>\tspecifies the password to use when connecting to mpd\n"
|
||||
" -s, --streamport <port>\tconnect to mpd http stream at port [8000]\n"
|
||||
" -i, --coverimage <filename>\tfilename for coverimage [folder.jpg]\n"
|
||||
" --help\t\t\t\tthis help\n"
|
||||
, argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user