4953 if(!db) { |
4953 if(!db) { |
4954 fprintf(stderr, "Cannot load sync directory database\n"); |
4954 fprintf(stderr, "Cannot load sync directory database\n"); |
4955 return -1; |
4955 return -1; |
4956 } |
4956 } |
4957 |
4957 |
|
4958 LocalResource *newres = NULL; |
4958 LocalResource *localres = ucx_map_cstr_get(db->resources, file.path); |
4959 LocalResource *localres = ucx_map_cstr_get(db->resources, file.path); |
|
4960 if(!localres) { |
|
4961 newres = calloc(1, sizeof(LocalResource)); |
|
4962 newres->path = strdup(file.path); |
|
4963 localres = newres; |
|
4964 } |
4959 UcxList *tags = NULL; |
4965 UcxList *tags = NULL; |
4960 DavBool store_tags = FALSE; |
4966 DavBool store_tags = FALSE; |
4961 |
4967 |
4962 if(cmd != CMD_TAG_SET) { |
4968 if(cmd != CMD_TAG_SET) { |
4963 char *tag = args->argv[1]; |
4969 char *tag = args->argv[1]; |
5015 localres->tags_hash = NULL; |
5021 localres->tags_hash = NULL; |
5016 } |
5022 } |
5017 localres->tags_hash = NULL; |
5023 localres->tags_hash = NULL; |
5018 } |
5024 } |
5019 } |
5025 } |
|
5026 } |
|
5027 |
|
5028 if(newres) { |
|
5029 local_resource_free(newres); |
5020 } |
5030 } |
5021 |
5031 |
5022 // store db |
5032 // store db |
5023 if(store_db(db, file.dir->database, file.dir->db_settings)) { |
5033 if(store_db(db, file.dir->database, file.dir->db_settings)) { |
5024 fprintf(stderr, "Cannot store sync db\n"); |
5034 fprintf(stderr, "Cannot store sync db\n"); |