Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
98e5f316
Vérifiée
Valider
98e5f316
rédigé
Il y a 4 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
REPO: Prepare to dl favorites from kurisu
parent
623fec06
Branches
Branches contenant la validation
Étiquettes
Étiquettes contenant la validation
1 requête de fusion
!122
Resolve "Import the "Favoris" from kurisu"
Modifications
3
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
README.md
+1
-1
1 ajout, 1 suppression
README.md
inc/lektor/config.def
+2
-2
2 ajouts, 2 suppressions
inc/lektor/config.def
src/module/module_repo.c
+34
-23
34 ajouts, 23 suppressions
src/module/module_repo.c
avec
37 ajouts
et
26 suppressions
README.md
+
1
−
1
Voir le fichier @
98e5f316
...
@@ -98,7 +98,7 @@ makepkg -si
...
@@ -98,7 +98,7 @@ makepkg -si
launch, because
`XDG_RUNTIME_DIR`
is not defined here. This folder is
launch, because
`XDG_RUNTIME_DIR`
is not defined here. This folder is
important, this is where most of your deamons are puttings theirs sockets and
important, this is where most of your deamons are puttings theirs sockets and
so. Blame Microsoft for that. A workaround is to export one:
`export
so. Blame Microsoft for that. A workaround is to export one:
`export
W
DG_RUNTIME_DIR=$(mktemp -d)`
before launching lektord. Be aware that you will
X
DG_RUNTIME_DIR=$(mktemp -d)`
before launching lektord. Be aware that you will
have issues with sound and videos becouse you will need to set up a X server...
have issues with sound and videos becouse you will need to set up a X server...
> Currently, supported compilers are: `icc` 19.1.2.254 and above, `gcc` 8.3.0 and
> Currently, supported compilers are: `icc` 19.1.2.254 and above, `gcc` 8.3.0 and
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
inc/lektor/config.def
+
2
−
2
Voir le fichier @
98e5f316
...
@@ -24,8 +24,8 @@ value("url", "https://kurisu.iiens.net")
...
@@ -24,8 +24,8 @@ value("url", "https://kurisu.iiens.net")
value
(
"json"
,
"https://kurisu.iiens.net/api"
)
value
(
"json"
,
"https://kurisu.iiens.net/api"
)
value
(
"id_json"
,
"https://kurisu.iiens.net/api/%ld"
)
value
(
"id_json"
,
"https://kurisu.iiens.net/api/%ld"
)
value
(
"id_kara"
,
"https://kurisu.iiens.net/api/download/%ld"
)
value
(
"id_kara"
,
"https://kurisu.iiens.net/api/download/%ld"
)
value
(
"fav_json"
,
"https://kurisu.iiens.net/api/fav/
%s
"
)
value
(
"fav_json"
,
"https://kurisu.iiens.net/api/fav/"
)
value
(
"plt_json"
,
"https://kurisu.iiens.net/api/plt/
%s
"
)
value
(
"plt_json"
,
"https://kurisu.iiens.net/api/plt/"
)
/* The player module, so that people can 'sing' when using lektor. By
/* The player module, so that people can 'sing' when using lektor. By
* default it's sdl, but one can create any module, for audio support
* default it's sdl, but one can create any module, for audio support
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/module/module_repo.c
+
34
−
23
Voir le fichier @
98e5f316
...
@@ -43,6 +43,7 @@ struct module_repo_internal {
...
@@ -43,6 +43,7 @@ struct module_repo_internal {
char
*
get_all_json
;
char
*
get_all_json
;
char
*
get_id_json
;
char
*
get_id_json
;
char
*
get_id_file
;
char
*
get_id_file
;
char
*
get_fav_json
;
const
uint64_t
version
;
const
uint64_t
version
;
/* Worker threads */
/* Worker threads */
...
@@ -489,27 +490,27 @@ __worker_import_favorites(void *__repo)
...
@@ -489,27 +490,27 @@ __worker_import_favorites(void *__repo)
{
{
struct
module_repo_internal
*
repo
=
__repo
;
struct
module_repo_internal
*
repo
=
__repo
;
//
GOTO_IF(pthread_mutex_lock(&(repo->mtx)), "Failed to lock", end_no_lock);
GOTO_IF
(
pthread_mutex_lock
(
&
(
repo
->
mtx
)),
"Failed to lock"
,
end_no_lock
);
//
repo->updating &= REPO_UPDATE_FAV;
repo
->
updating
&=
REPO_UPDATE_FAV
;
//
GOTO_IF(pthread_mutex_unlock(&(repo->mtx)), "Failed to unlock", end_no_lock);
GOTO_IF
(
pthread_mutex_unlock
(
&
(
repo
->
mtx
)),
"Failed to unlock"
,
end_no_lock
);
//
//
struct json_object *json;
// struct json_object *json;
//
LOG_INFO("REPO", "Download favorite lists from %s (%s), directory is %s",
LOG_INFO
(
"REPO"
,
"Download favorite lists from %s (%s), directory is %s"
,
//
repo->name, repo->get_all_json, repo->kara_dir);
repo
->
name
,
repo
->
get_all_json
,
repo
->
kara_dir
);
//
//
if (__json_sync(repo, &json)) {
// if (__json_sync(repo, &json)) {
//
//
LOG_ERROR("REPO", "Failed to get json, possibly no internet connexion or repo is down");
// LOG_ERROR("REPO", "Failed to get json, possibly no internet connexion or repo is down");
//
//
pthread_exit(NULL);
// pthread_exit(NULL);
//
//
}
// }
//
//
__handle_got_json(repo->db, repo, json);
// __handle_got_json(repo->db, repo, json);
//
//
LOG_INFO("REPO", "Finished to download and insert kara list");
// LOG_INFO("REPO", "Finished to download and insert kara list");
//
//
json_object_put(json);
// json_object_put(json);
//
//
__handle_deleted_kara(repo->db);
// __handle_deleted_kara(repo->db);
//
//
LOG_INFO("REPO", "Finished to deal with deleted kara");
// LOG_INFO("REPO", "Finished to deal with deleted kara");
//
//
database_updated(repo->db);
// database_updated(repo->db);
//
GOTO_IF(pthread_mutex_lock(&(repo->mtx)), "Failed to lock", end_no_lock);
GOTO_IF
(
pthread_mutex_lock
(
&
(
repo
->
mtx
)),
"Failed to lock"
,
end_no_lock
);
//
repo->updating &= (~ REPO_UPDATE_FAV);
repo
->
updating
&=
(
~
REPO_UPDATE_FAV
);
//
GOTO_IF(pthread_mutex_unlock(&(repo->mtx)), "Failed to unlock", end_no_lock);
GOTO_IF
(
pthread_mutex_unlock
(
&
(
repo
->
mtx
)),
"Failed to unlock"
,
end_no_lock
);
end_no_lock:
end_no_lock:
pthread_exit
(
NULL
);
pthread_exit
(
NULL
);
...
@@ -559,6 +560,7 @@ module_repo_new(struct module_repo_internal *repo_, struct queue *queue, volatil
...
@@ -559,6 +560,7 @@ module_repo_new(struct module_repo_internal *repo_, struct queue *queue, volatil
.
kara_dir
=
safe_zero_malloc
(
PATH_MAX
*
sizeof
(
char
)),
.
kara_dir
=
safe_zero_malloc
(
PATH_MAX
*
sizeof
(
char
)),
.
get_id_json
=
safe_zero_malloc
(
LKT_LINE_MAX
*
sizeof
(
char
)),
.
get_id_json
=
safe_zero_malloc
(
LKT_LINE_MAX
*
sizeof
(
char
)),
.
get_id_file
=
safe_zero_malloc
(
LKT_LINE_MAX
*
sizeof
(
char
)),
.
get_id_file
=
safe_zero_malloc
(
LKT_LINE_MAX
*
sizeof
(
char
)),
.
get_fav_json
=
safe_zero_malloc
(
LKT_LINE_MAX
*
sizeof
(
char
)),
.
get_all_json
=
safe_zero_malloc
(
LKT_LINE_MAX
*
sizeof
(
char
)),
.
get_all_json
=
safe_zero_malloc
(
LKT_LINE_MAX
*
sizeof
(
char
)),
.
base_url
=
safe_zero_malloc
(
LKT_LINE_MAX
*
sizeof
(
char
)),
.
base_url
=
safe_zero_malloc
(
LKT_LINE_MAX
*
sizeof
(
char
)),
.
craft_filename
=
obfuscate
?
__craft_filename_obfuscate
:
__craft_filename_non_obfuscate
,
.
craft_filename
=
obfuscate
?
__craft_filename_obfuscate
:
__craft_filename_non_obfuscate
,
...
@@ -570,6 +572,7 @@ module_repo_new(struct module_repo_internal *repo_, struct queue *queue, volatil
...
@@ -570,6 +572,7 @@ module_repo_new(struct module_repo_internal *repo_, struct queue *queue, volatil
!
database_config_get_text
(
db
,
"repo"
,
"url"
,
repo
.
base_url
,
LKT_LINE_MAX
)
||
!
database_config_get_text
(
db
,
"repo"
,
"url"
,
repo
.
base_url
,
LKT_LINE_MAX
)
||
!
database_config_get_text
(
db
,
"repo"
,
"id_json"
,
repo
.
get_id_json
,
LKT_LINE_MAX
)
||
!
database_config_get_text
(
db
,
"repo"
,
"id_json"
,
repo
.
get_id_json
,
LKT_LINE_MAX
)
||
!
database_config_get_text
(
db
,
"repo"
,
"id_kara"
,
repo
.
get_id_file
,
LKT_LINE_MAX
)
||
!
database_config_get_text
(
db
,
"repo"
,
"id_kara"
,
repo
.
get_id_file
,
LKT_LINE_MAX
)
||
!
database_config_get_text
(
db
,
"repo"
,
"fav_json"
,
repo
.
get_fav_json
,
LKT_LINE_MAX
)
||
!
database_config_get_text
(
db
,
"repo"
,
"json"
,
repo
.
get_all_json
,
LKT_LINE_MAX
)
)
{
!
database_config_get_text
(
db
,
"repo"
,
"json"
,
repo
.
get_all_json
,
LKT_LINE_MAX
)
)
{
LOG_ERROR
(
"REPO"
,
"Configuration invalid, but it should not be at this point"
);
LOG_ERROR
(
"REPO"
,
"Configuration invalid, but it should not be at this point"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
@@ -652,6 +655,7 @@ mod_free(va_list *va)
...
@@ -652,6 +655,7 @@ mod_free(va_list *va)
free
((
*
repo
)
->
get_id_file
);
free
((
*
repo
)
->
get_id_file
);
free
((
*
repo
)
->
base_url
);
free
((
*
repo
)
->
base_url
);
free
((
*
repo
)
->
get_all_json
);
free
((
*
repo
)
->
get_all_json
);
free
((
*
repo
)
->
get_fav_json
);
LOG_INFO
(
"REPO"
,
"Repo module terminated"
);
LOG_INFO
(
"REPO"
,
"Repo module terminated"
);
va_end
(
copy
);
va_end
(
copy
);
...
@@ -740,6 +744,7 @@ mod_import(va_list *va)
...
@@ -740,6 +744,7 @@ mod_import(va_list *va)
struct
module_repo_internal
**
repo
;
struct
module_repo_internal
**
repo
;
va_copy
(
copy
,
*
va
);
va_copy
(
copy
,
*
va
);
repo
=
(
struct
module_repo_internal
**
)
va_arg
(
copy
,
void
**
);
repo
=
(
struct
module_repo_internal
**
)
va_arg
(
copy
,
void
**
);
int
ret
=
0
;
GOTO_IF
(
pthread_mutex_lock
(
&
(
*
repo
)
->
mtx
),
"Failed to lock"
,
end_no_lock
);
GOTO_IF
(
pthread_mutex_lock
(
&
(
*
repo
)
->
mtx
),
"Failed to lock"
,
end_no_lock
);
if
((
*
repo
)
->
updating
&
REPO_UPDATE_FAV
)
{
if
((
*
repo
)
->
updating
&
REPO_UPDATE_FAV
)
{
...
@@ -748,11 +753,17 @@ mod_import(va_list *va)
...
@@ -748,11 +753,17 @@ mod_import(va_list *va)
}
}
(
*
repo
)
->
updating
&=
REPO_UPDATE_FAV
;
(
*
repo
)
->
updating
&=
REPO_UPDATE_FAV
;
if
(
worker_pool_push
(
&
(
*
repo
)
->
workers
,
__worker_import_favorites
,
(
void
*
)
*
repo
))
{
LOG_ERROR
(
"REPO"
,
"Out of memory"
);
ret
=
1
;
goto
end
;
}
end:
end:
GOTO_IF
(
pthread_mutex_unlock
(
&
(
*
repo
)
->
mtx
),
"Failed to unlock"
,
end_no_lock
);
GOTO_IF
(
pthread_mutex_unlock
(
&
(
*
repo
)
->
mtx
),
"Failed to unlock"
,
end_no_lock
);
end_no_lock:
end_no_lock:
va_end
(
copy
);
va_end
(
copy
);
return
0
;
return
ret
;
}
}
REG_BEGIN
(
repo_reg
)
REG_BEGIN
(
repo_reg
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter