aboutsummaryrefslogtreecommitdiff
path: root/src/html.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-07-16 20:27:53 +0200
committerdec05eba <dec05eba@protonmail.com>2024-07-16 20:27:53 +0200
commitcfc9ef1cade470f6d2a7ba67c625eb8c11ff2743 (patch)
treecab15e6b04b8773d98ed5165ab3efca3775e5f4f /src/html.c
parentb3ef5d250c3cc4e35e82812bfd29fb19eb9bba83 (diff)
Add fallback urls for rss (right now, fallback nyaa.si to nyaa.land)
Diffstat (limited to 'src/html.c')
-rw-r--r--src/html.c7
1 files changed, 3 insertions, 4 deletions
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;