mirror of
https://github.com/simon987/sist2.git
synced 2025-12-13 15:29:04 +00:00
Fix thumbnail copying for incremental index, fix incremental index when there are no new updates, add option for JSON logs output
This commit is contained in:
15
src/util.c
15
src/util.c
@@ -86,6 +86,21 @@ char *expandpath(const char *path) {
|
||||
|
||||
int PrintingProgressBar = 0;
|
||||
|
||||
#define BOOLEAN_STRING(x) ((x) == 0 ? "false" : "true")
|
||||
|
||||
void progress_bar_print_json(size_t done, size_t count, size_t tn_size, size_t index_size, int waiting) {
|
||||
|
||||
char log_str[1024];
|
||||
|
||||
size_t log_len = snprintf(
|
||||
log_str, sizeof(log_str),
|
||||
"{\"progress\": {\"done\":%lu,\"count\":%lu,\"tn_size\":%lu,\"index_size\":%lu,\"waiting\":%s}}\n",
|
||||
done, count, tn_size, index_size, BOOLEAN_STRING(waiting)
|
||||
);
|
||||
|
||||
write(STDOUT_FILENO, log_str, log_len);
|
||||
}
|
||||
|
||||
void progress_bar_print(double percentage, size_t tn_size, size_t index_size) {
|
||||
|
||||
static int last_val = -1;
|
||||
|
||||
Reference in New Issue
Block a user