mirror of
https://github.com/SuperBFG7/ympd
synced 2025-01-13 10:50:36 +00:00
Configurable coverimage filename
This commit is contained in:
parent
7013d2f557
commit
14ef6648c6
@ -53,6 +53,7 @@ Usage: ./mympd [OPTION]...
|
|||||||
-s, --streamport <port> connect to mpd http stream at port [8000]
|
-s, --streamport <port> connect to mpd http stream at port [8000]
|
||||||
-u, --user <username> drop priviliges to user after socket bind
|
-u, --user <username> drop priviliges to user after socket bind
|
||||||
-m, --mpdpass <password> specifies the password to use when connecting to mpd
|
-m, --mpdpass <password> specifies the password to use when connecting to mpd
|
||||||
|
-i, --coverimage <filename> filename for coverimage [folder.jpg]
|
||||||
-V, --version get version
|
-V, --version get version
|
||||||
--help this help
|
--help this help
|
||||||
```
|
```
|
||||||
|
7
mympd.1
7
mympd.1
@ -30,12 +30,15 @@ specifies the port for the webserver to listen to, defaults to 8080
|
|||||||
\fB-s\fR, \fB\-\-streamport PORT
|
\fB-s\fR, \fB\-\-streamport PORT
|
||||||
connect to mpd http stream at port [8000]
|
connect to mpd http stream at port [8000]
|
||||||
.TP
|
.TP
|
||||||
\fB\-u\fR, \fB\-\-user username\fR
|
\fB\-u\fR, \fB\-\-user USERNAME\fR
|
||||||
drop privileges to the provided username after socket binding
|
drop privileges to the provided username after socket binding
|
||||||
.TP
|
.TP
|
||||||
\fB\-m\fR, \fB\-\-mpdpass password\fR
|
\fB\-m\fR, \fB\-\-mpdpass PASSWORD\fR
|
||||||
specifies the password to use when connecting to mpd
|
specifies the password to use when connecting to mpd
|
||||||
.TP
|
.TP
|
||||||
|
\fB-i\fR, \fB\-\-coverimage FILENAME\fR
|
||||||
|
filename for coverimage [folder.jpg]
|
||||||
|
.TP
|
||||||
\fB\-V\fR, \fB\-\-version\fR
|
\fB\-V\fR, \fB\-\-version\fR
|
||||||
print version and exit
|
print version and exit
|
||||||
.TP
|
.TP
|
||||||
|
@ -299,8 +299,9 @@ out_send_message:
|
|||||||
break;
|
break;
|
||||||
case MPD_API_GET_OPTIONS:
|
case MPD_API_GET_OPTIONS:
|
||||||
n = snprintf(mpd.buf, MAX_SIZE, "{\"type\":\"mpdoptions\", \"data\": "
|
n = snprintf(mpd.buf, MAX_SIZE, "{\"type\":\"mpdoptions\", \"data\": "
|
||||||
"{\"mpdhost\" : \"%s\", \"mpdport\": \"%d\", \"passwort_set\": %s, \"streamport\": \"%d\"}"
|
"{\"mpdhost\" : \"%s\", \"mpdport\": \"%d\", \"passwort_set\": %s, "
|
||||||
"}", mpd.host, mpd.port, mpd.password ? "true" : "false", streamport);
|
"\"streamport\": \"%d\",\"coverimage\": \"%s\"}"
|
||||||
|
"}", mpd.host, mpd.port, mpd.password ? "true" : "false", streamport, coverimage);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,10 +89,10 @@ enum mpd_conn_states {
|
|||||||
|
|
||||||
struct t_mpd {
|
struct t_mpd {
|
||||||
int port;
|
int port;
|
||||||
int local_port;
|
int local_port;
|
||||||
char host[128];
|
char host[128];
|
||||||
char *password;
|
char *password;
|
||||||
char *gpass;
|
char *gpass;
|
||||||
|
|
||||||
struct mpd_connection *conn;
|
struct mpd_connection *conn;
|
||||||
enum mpd_conn_states conn_state;
|
enum mpd_conn_states conn_state;
|
||||||
@ -106,6 +106,7 @@ struct t_mpd {
|
|||||||
} mpd;
|
} mpd;
|
||||||
|
|
||||||
int streamport;
|
int streamport;
|
||||||
|
char coverimage[40];
|
||||||
|
|
||||||
struct t_mpd_client_session {
|
struct t_mpd_client_session {
|
||||||
int song_id;
|
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_queue(char *buffer, unsigned int offset);
|
||||||
int mpd_put_browse(char *buffer, char *path, unsigned int offset);
|
int mpd_put_browse(char *buffer, char *path, unsigned int offset);
|
||||||
int mpd_search(char *buffer, char *searchstr);
|
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();
|
void mpd_disconnect();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ int main(int argc, char **argv)
|
|||||||
mpd.gpass = NULL;
|
mpd.gpass = NULL;
|
||||||
strcpy(mpd.host, "127.0.0.1");
|
strcpy(mpd.host, "127.0.0.1");
|
||||||
streamport = 8000;
|
streamport = 8000;
|
||||||
|
strcpy(coverimage, "folder.jpg");
|
||||||
|
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"digest", required_argument, 0, 'D'},
|
{"digest", required_argument, 0, 'D'},
|
||||||
@ -107,10 +108,11 @@ int main(int argc, char **argv)
|
|||||||
{"help", no_argument, 0, 0 },
|
{"help", no_argument, 0, 0 },
|
||||||
{"mpdpass", required_argument, 0, 'm'},
|
{"mpdpass", required_argument, 0, 'm'},
|
||||||
{"streamport", required_argument, 0, 's'},
|
{"streamport", required_argument, 0, 's'},
|
||||||
|
{"coverimage", required_argument, 0, 'i'},
|
||||||
{0, 0, 0, 0 }
|
{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) {
|
long_options, &option_index)) != -1) {
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 'D':
|
case 'D':
|
||||||
@ -138,6 +140,9 @@ int main(int argc, char **argv)
|
|||||||
case 's':
|
case 's':
|
||||||
streamport = atoi(optarg);
|
streamport = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
case 'i':
|
||||||
|
strncpy(coverimage, optarg, sizeof(coverimage));
|
||||||
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
fprintf(stdout, "myMPD %d.%d.%d\n"
|
fprintf(stdout, "myMPD %d.%d.%d\n"
|
||||||
"Copyright (C) 2018 Juergen Mang <mail@jcgames.de>\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"
|
" -v, --version\t\t\tget version\n"
|
||||||
" -m, --mpdpass <password>\tspecifies the password to use when connecting to mpd\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"
|
" -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"
|
" --help\t\t\t\tthis help\n"
|
||||||
, argv[0]);
|
, argv[0]);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
Loading…
Reference in New Issue
Block a user