diff --git a/inc/lektor/queue.h b/inc/lektor/queue.h index 88a7fe7d9218e60f562af72a2aac07b73f20fff2..9e0634133249bad67cf26e468eefc09836b2378d 100644 --- a/inc/lektor/queue.h +++ b/inc/lektor/queue.h @@ -132,11 +132,6 @@ lkt_queue_send(struct queue *queue, enum lkt_event_type _type, void *_attr) if (! (_type & queue->available)) LOG_WARN("QUEUE", "The event %d is not available, push it anyway", _type); - else if (_attr) { - LOG_DEBUG("QUEUE", "Pushed event %d with attr (int: %d, ptr %0*p)", - evt.type, evt.attr, sizeof(size_t) * CHAR_BIT / 4, evt.attr); - } else - LOG_DEBUG("QUEUE", "Pushed event %d with NULL attr", evt.type); end: pthread_mutex_unlock(&queue->lock); } @@ -159,13 +154,6 @@ lkt_queue_handle(struct queue *queue) queue->last -= 1; end: pthread_mutex_unlock(&queue->lock); - if (ret.attr) { - LOG_DEBUG("QUEUE", "Handle event %d with attr (int: %d, ptr: %0*p)", - ret.type, ret.attr, sizeof(size_t) * CHAR_BIT / 4, ret.attr); - } else if (ret.type) { - /* Don't do anyhting with the 'null' event */ - LOG_DEBUG("QUEUE", "Handle event %d with NULL attr", ret.type); - } return ret; } diff --git a/src/module/module_repo.c b/src/module/module_repo.c index 81bf16929c0ce1d48a5370914883166dd3052404..d05c07a1a9bfdd123caf1dcf813dd53c495b49fb 100644 --- a/src/module/module_repo.c +++ b/src/module/module_repo.c @@ -562,6 +562,7 @@ __handle_fav_list_internal(const char UNUSED *key, const char *val, int UNUSED c struct __uri *uri = (struct __uri *) user; uri->uri.id = strtol(val, NULL, 0); + lkt_queue_send(uri->repo->queue, lkt_event_db_update_tick, NULL); if (!database_plt_add_uri(uri->repo->db, uri->fav, &uri->uri)) { LOG_ERROR("REPO", "Failed to add kara %ld to playlist %s", uri->uri.id, uri->fav); return; @@ -608,6 +609,8 @@ __handle_fav_list(struct module_repo_internal *repo, char *fav, size_t fav_size) }, }; + size_t len = json_parse_get_count(json, 2); + lkt_queue_send(repo->queue, lkt_event_db_update_total, (void *) (size_t) len); json_parse(json, 2, __handle_fav_list_internal, (void *) &uri); LOG_INFO("REPO", "Finished importing fav list '%s' as '%s'", fav_origin, fav); free(json);