Skip to content
Extraits de code Groupes Projets

Resolve "FEATURE: Use time stamp from kurisu in update process"

Fusionnées Kubat a demandé de fusionner 109-feature-use-time-stamp-from-kurisu-in-update-process vers master
1 file
+ 17
4
Comparer les modifications
  • Côte à côte
  • En ligne
+ 17
4
@@ -396,6 +396,20 @@ ___handle_got_json_dl(struct kara *kara)
kara->filename);
}
PRIVATE_FUNCTION void
___update_repo_timestamp_if_needed_on_ignore_kara(struct kara *kara, uint64_t repo_ts)
{
uint64_t stored_ts = 0;
const bool found_ts = database_get_kara_repo_timestamp_id(kara->db, (int)kara->id, &stored_ts);
if ((!found_ts) || (stored_ts <= 0)) {
LOG_INFO("REPO",
"Update repo unix timestamp of kara %ld because it was "
"not present in the DB (update of the DB scheme)",
kara->id);
database_set_kara_repo_timestamp_id(kara->db, (int)kara->id, repo_ts);
}
}
PRIVATE_FUNCTION int
___handle_got_json_internal_callback(const char *key, const char *val, int comp, void *user)
{
@@ -514,10 +528,8 @@ ___handle_got_json_internal_callback(const char *key, const char *val, int comp,
/* Ignore kara */
else {
++(kara->ignored_count);
/* Don't burn the disk */
___sleep();
___update_repo_timestamp_if_needed_on_ignore_kara(kara, (uint64_t)kara->unix_timestamp);
___sleep(); /* Don't burn the disk */
lkt_queue_send(kara->repo->queue, LKT_EVENT_TOUCH_KARA, (void *)(size_t)kara->id);
lkt_queue_send(kara->repo->queue, LKT_EVENT_DB_UPDATE_TICK, NULL);
LOG_DEBUG("REPO", "Ignore kara %ld", kara->id);
@@ -527,6 +539,7 @@ ___handle_got_json_internal_callback(const char *key, const char *val, int comp,
do_it:
/* Even if we must download the kara, the user could have filtered it out! */
if (lkt_uri_match_kara_metadata(filter, &kara->mdt, kara->db, (int)kara->id)) {
___update_repo_timestamp_if_needed_on_ignore_kara(kara, (uint64_t)kara->unix_timestamp);
LOG_DEBUG("REPO", "The kara %ld is ignored because it was filtered out", kara->id);
++(kara->ignored_count);
return 0;
Chargement en cours