From cfc9ef1cade470f6d2a7ba67c625eb8c11ff2743 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 16 Jul 2024 20:27:53 +0200 Subject: Add fallback urls for rss (right now, fallback nyaa.si to nyaa.land) --- src/html.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/html.c') diff --git a/src/html.c b/src/html.c index a83d33f..a0a5e73 100644 --- a/src/html.c +++ b/src/html.c @@ -364,7 +364,7 @@ int add_html(const char *name, const char *url, char *html_config_dir, char *pro } size_t num_download_items = download_items_start ? (((DownloadItemsData*)buffer_end(&download_items_buffer)) - download_items_start) : 0; - result = write_plugin_json_to_file(html_tracked_dir, "data", url, updated, download_items_start, num_download_items, plugin_name); + result = write_plugin_json_to_file(html_tracked_dir, "data", url, updated, download_items_start, num_download_items, plugin_name, NULL); if(result != 0) { fprintf(stderr, "Failed to create %s/data\n", html_tracked_dir); remove_recursive(html_tracked_dir); @@ -426,7 +426,7 @@ static int download_html_items_in_reverse(const char *plugin_filepath, Buffer *d if(result != 0) fprintf(stderr, "Failed while downloading html, url: %s\n", download_items_it->link); - const char *notify_args[] = { "notify-send", "-a", "automedia", "-u", result == 0 ? "low" : "critical", "-t", "3000", "--", result == 0 ? "Download finished" : "Download failed", notify_msg, NULL }; + const char *notify_args[] = { "notify-send", "-a", "automedia", "-u", result == 0 ? "low" : "critical", "-t", "5000", "--", result == 0 ? "Download finished" : "Download failed", notify_msg, NULL }; program_exec(notify_args, NULL, NULL); if(result != 0) @@ -447,9 +447,8 @@ static int download_html_items_in_reverse(const char *plugin_filepath, Buffer *d TrackedItem tracked_item; tracked_item.title = tracked_html->title; - tracked_item.link = tracked_html->link; tracked_item.json_data = tracked_html->json_data; - result = tracked_item_update_latest(&tracked_item, html_tracked_dir, added_download_items, NULL, timestamps, download_item_index); + result = tracked_item_update_latest(&tracked_item, html_tracked_dir, added_download_items, NULL, timestamps, download_item_index, NULL); buffer_deinit(&json_element_buffer); return result; -- cgit v1.2.3