aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-17 02:03:11 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-17 02:03:11 +0200
commitd9d1363ee5a06eb6632e15a14afe64ec80c3df56 (patch)
tree2c2fb02d290530d96e3f389588b272c0a410c65f /src/main.c
parentf869fff9e9b27562837e90400bb3cca098a0376a (diff)
Do not show start after items in the downloaded list
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index b47e24a..28130f6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -108,13 +108,15 @@ static void data_file_get_downloaded(const char *dir_name, const char *data_file
goto cleanup;
}
- size_t dir_name_len = strlen(dir_name);
-
const cJSON *downloaded_item_json = NULL;
cJSON_ArrayForEach(downloaded_item_json, downloaded_json) {
if(!cJSON_IsObject(downloaded_item_json))
continue;
+ const cJSON *filler_json = cJSON_GetObjectItemCaseSensitive(downloaded_item_json, "filler");
+ if(cJSON_IsTrue(filler_json))
+ continue;
+
const cJSON *time_json = cJSON_GetObjectItemCaseSensitive(downloaded_item_json, "time");
if(!time_json || !cJSON_IsString(time_json))
continue;
@@ -128,9 +130,7 @@ static void data_file_get_downloaded(const char *dir_name, const char *data_file
strcpy(title, filename_json->valuestring);
} else if(title_json && cJSON_IsString(title_json)) {
if(is_html) {
- strcpy(title, dir_name);
- title[dir_name_len] = '/';
- strcpy(title + dir_name_len + 1, title_json->valuestring);
+ snprintf(title, sizeof(title), "%s/%s", dir_name, title_json->valuestring);
} else {
strcpy(title, title_json->valuestring);
}