aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Mangatown.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Mangatown.cpp')
-rw-r--r--src/plugins/Mangatown.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/plugins/Mangatown.cpp b/src/plugins/Mangatown.cpp
index ec5f279..4e7046c 100644
--- a/src/plugins/Mangatown.cpp
+++ b/src/plugins/Mangatown.cpp
@@ -41,13 +41,13 @@ namespace QuickMedia {
}
}, &result_items);
- BodyItemImageContext body_item_image_context;
+ BodyItemContext body_item_image_context;
body_item_image_context.body_items = &result_items;
body_item_image_context.index = 0;
result = quickmedia_html_find_nodes_xpath(&html_search, "//a[class='manga_cover']/img",
[](QuickMediaHtmlNode *node, void *userdata) {
- auto *item_data = (BodyItemImageContext*)userdata;
+ auto *item_data = (BodyItemContext*)userdata;
const char *src = quickmedia_html_node_get_attribute_value(node, "src");
if(src && item_data->index < item_data->body_items->size()) {
(*item_data->body_items)[item_data->index]->thumbnail_url = src;
@@ -92,6 +92,21 @@ namespace QuickMedia {
}
}, &chapters_items);
+ BodyItemContext body_item_context;
+ body_item_context.body_items = &chapters_items;
+ body_item_context.index = 0;
+
+ quickmedia_html_find_nodes_xpath(&html_search, "//ul[class='chapter_list']//span[class='time']",
+ [](QuickMediaHtmlNode *node, void *userdata) {
+ auto *item_data = (BodyItemContext*)userdata;
+ const char *text = quickmedia_html_node_get_text(node);
+ if(text && item_data->index < item_data->body_items->size()) {
+ std::string uploaded_date = strip(text);
+ (*item_data->body_items)[item_data->index]->set_description("Uploaded: " + uploaded_date);
+ item_data->index++;
+ }
+ }, &body_item_context);
+
cleanup:
quickmedia_html_search_deinit(&html_search);
if(result != 0)