Skip to content
Extraits de code Groupes Projets
Vérifiée Valider a664aa0c rédigé par Kubat's avatar Kubat
Parcourir les fichiers

QUEUE & MOD: Now the update total count includes the number of favorites in...

QUEUE & MOD: Now the update total count includes the number of favorites in each lists & less verbose queue
parent b35c022a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!141Improve MPD compatibility
......@@ -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;
}
......
......@@ -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);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter