added flags for Sonic ID3 mode support

This commit is contained in:
Fufu Fang 2019-10-25 17:06:09 +01:00
parent 2f920486be
commit 8a4d47d71d
No known key found for this signature in database
GPG Key ID: 0F6BB5EF6F8BB729
3 changed files with 9 additions and 0 deletions

View File

@ -151,6 +151,7 @@ parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc)
{"cache-location", required_argument, NULL, 'L'}, /* 14 */
{"sonic-username", required_argument, NULL, 'L'}, /* 15 */
{"sonic-password", required_argument, NULL, 'L'}, /* 16 */
{"sonic-password", no_argument, NULL, 'L'}, /* 17 */
{0, 0, 0, 0}
};
while ((c =
@ -224,6 +225,8 @@ parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc)
case 16:
CONFIG.sonic_password = strdup(optarg);
break;
case 17:
CONFIG.sonic_id3 = 1;
default:
fprintf(stderr, "see httpdirfs -h for usage\n");
return 1;
@ -300,5 +303,7 @@ HTTPDirFS options:\n\
For mounting a Airsonic / Subsonic server:\n\
--sonic-username The username for your Airsonic / Subsonic server\n\
--sonic-password The username for your Airsonic / Subsonic server\n\
--sonic-id3 Enable ID3 mode - this present the server content in\n\
Artist/Album/Song layout \n\
\n");
}

View File

@ -87,6 +87,8 @@ void Config_init(void)
CONFIG.sonic_username = NULL;
CONFIG.sonic_password = NULL;
CONFIG.sonic_id3 = 0;
}
char *path_append(const char *path, const char *filename)

View File

@ -69,6 +69,8 @@ typedef struct {
char *sonic_username;
/** \brief The Sonic server password */
char *sonic_password;
/** \brief Whether we are using Sonic mode ID3 extension */
int sonic_id3;
} ConfigStruct;
/**