]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - aft.c
afs: Minor improvements and fixes.
[paraslash.git] / aft.c
diff --git a/aft.c b/aft.c
index e1004d00c081eb77cdcdb04abc4554b13aa00715..1d7680714f05d39e1c0c057aaaf95b412e1626b6 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -704,7 +704,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                        w->image_id_width, afsi->image_id,
                        w->lyrics_id_width, afsi->lyrics_id,
                        w->bitrate_width, afhi->bitrate,
                        w->image_id_width, afsi->image_id,
                        w->lyrics_id_width, afsi->lyrics_id,
                        w->bitrate_width, afhi->bitrate,
-                       audio_format_name(afsi->audio_format_id), /* FIXME */
+                       audio_format_name(afsi->audio_format_id),
                        w->frequency_width, afhi->frequency,
                        afhi->channels,
                        duration_buf,
                        w->frequency_width, afhi->frequency,
                        afhi->channels,
                        duration_buf,
@@ -745,7 +745,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                        image_line,
                        lyrics_line,
                        afhi->bitrate,
                        image_line,
                        lyrics_line,
                        afhi->bitrate,
-                       "mp3", /* FIXME */
+                       audio_format_name(afsi->audio_format_id),
                        afhi->frequency,
                        afhi->channels,
                        duration_buf,
                        afhi->frequency,
                        afhi->channels,
                        duration_buf,
@@ -1244,6 +1244,8 @@ afhi <=> force or no HS
 #define ADD_FLAG_FORCE 2
 #define ADD_FLAG_VERBOSE 4
 
 #define ADD_FLAG_FORCE 2
 #define ADD_FLAG_VERBOSE 4
 
+/* TODO: change log messages so that they get written to the result buffer */
+
 static int com_add_callback(const struct osl_object *query,
                __a_unused struct osl_object *result)
 {
 static int com_add_callback(const struct osl_object *query,
                __a_unused struct osl_object *result)
 {
@@ -1421,7 +1423,7 @@ static int add_one_audio_file(const char *arg, const void *private_data)
        ret = 1;
        if (pb && (pad->flags & ADD_FLAG_LAZY)) { /* lazy is really cheap */
                if (pad->flags & ADD_FLAG_VERBOSE)
        ret = 1;
        if (pb && (pad->flags & ADD_FLAG_LAZY)) { /* lazy is really cheap */
                if (pad->flags & ADD_FLAG_VERBOSE)
-                       PARA_NOTICE_LOG("lazy-ignore: %s\n", path);
+                       ret = send_va_buffer(pad->fd, "lazy-ignore: %s\n", path);
                goto out_free;
        }
        /* We still want to add this file. Compute its hash. */
                goto out_free;
        }
        /* We still want to add this file. Compute its hash. */
@@ -1444,7 +1446,8 @@ static int add_one_audio_file(const char *arg, const void *private_data)
        ret = 1;
        if (pb && hs && hs == pb && (!(pad->flags & ADD_FLAG_FORCE))) {
                if (pad->flags & ADD_FLAG_VERBOSE)
        ret = 1;
        if (pb && hs && hs == pb && (!(pad->flags & ADD_FLAG_FORCE))) {
                if (pad->flags & ADD_FLAG_VERBOSE)
-                       PARA_NOTICE_LOG("not forcing update: %s\n", path);
+                       ret = send_va_buffer(pad->fd,
+                               "not forcing update: %s\n", path);
                goto out_unmap;
        }
        /*
                goto out_unmap;
        }
        /*
@@ -1454,8 +1457,8 @@ static int add_one_audio_file(const char *arg, const void *private_data)
        if (!hs || (pad->flags & ADD_FLAG_FORCE)) {
                ret = compute_afhi(path, map.data, map.size, &afhi);
                if (ret < 0) {
        if (!hs || (pad->flags & ADD_FLAG_FORCE)) {
                ret = compute_afhi(path, map.data, map.size, &afhi);
                if (ret < 0) {
-                       PARA_WARNING_LOG("audio format of %s not recognized, skipping\n", path);
-                       ret = 1;
+                       ret = send_va_buffer(pad->fd,
+                               "audio format of %s not recognized\n", path);
                        goto out_unmap;
                }
                format_num = ret;
                        goto out_unmap;
                }
                format_num = ret;