H:
H: Options:
H:
+H: -a Add all files. The default is to add only files ending in a known suffix
+H: for a supported audio format.
+H:
H: -l Add files lazily. If a file already exists in the database, skip this file.
H: This operation is really cheap. Use it when adding large directories if only a
H: few files where added.
H:
H: -sy: sort by lyrics id.
H:
-H: -sb: sort by bitrate.
+H: -sb: sort by bit rate.
H:
H: -sd: sort by duration.
H:
#define ADD_FLAG_LAZY 1
#define ADD_FLAG_FORCE 2
#define ADD_FLAG_VERBOSE 4
+#define ADD_FLAG_ALL 8
/* TODO: change log messages so that they get written to the result buffer */
ret = verify_path(arg, &path);
if (ret < 0)
goto out_free;
+ ret = guess_audio_format(path);
+ if (ret < 0 && !(pad->flags & ADD_FLAG_ALL))
+ goto out_free;
query.data = path;
query.size = strlen(path) + 1;
ret = send_callback_request(path_brother_callback, &query, &result);
i++;
break;
}
+ if (!strcmp(arg, "-a")) {
+ pad.flags |= ADD_FLAG_ALL;
+ continue;
+ }
if (!strcmp(arg, "-l")) {
pad.flags |= ADD_FLAG_LAZY;
continue;
#define VSS_ERRORS \
+ PARA_ERROR(BAD_AUDIO_FILE_SUFFIX, "unknown suffix"), \
PARA_ERROR(AUDIO_FORMAT, "audio format not recognized"), \
PARA_ERROR(CHUNK, "unable to get chunk"), \
return i;
}
}
- return -1;
+ return -E_BAD_AUDIO_FILE_SUFFIX;
}
static int get_audio_format(int omit)