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
1dc8deb6
Vérifiée
Valider
1dc8deb6
rédigé
Il y a 5 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Don't specify the mkvpropedit path with hard defined strings.
parent
ce5d0e69
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!44
Metadata write
Modifications
3
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
inc/lektor/mkv.h
+2
-2
2 ajouts, 2 suppressions
inc/lektor/mkv.h
src/main/lktadm.c
+10
-4
10 ajouts, 4 suppressions
src/main/lktadm.c
src/mkv/write.c
+6
-7
6 ajouts, 7 suppressions
src/mkv/write.c
avec
18 ajouts
et
13 suppressions
inc/lektor/mkv.h
+
2
−
2
Voir le fichier @
1dc8deb6
...
@@ -44,7 +44,7 @@ int kara_metadata_write(struct kara_metadata *mdt, const char *filename,
...
@@ -44,7 +44,7 @@ int kara_metadata_write(struct kara_metadata *mdt, const char *filename,
const
char
*
mkvpropedit
);
const
char
*
mkvpropedit
);
/* Set the metadata for the file according to its path. */
/* Set the metadata for the file according to its path. */
int
metadata_set_file
(
char
*
karapath
);
int
metadata_set_file
(
char
*
karapath
,
const
char
*
mkvpropedit
);
/* Set metadata for files under a given directory by their path. */
/* Set metadata for files under a given directory by their path. */
int
metadata_set_directory
(
const
char
*
kara_dir
);
int
metadata_set_directory
(
const
char
*
kara_dir
,
const
char
*
mkvpropedit
);
Ce diff est replié.
Cliquez pour l'agrandir.
src/main/lktadm.c
+
10
−
4
Voir le fichier @
1dc8deb6
...
@@ -31,7 +31,7 @@ main(int argc, char *argv[])
...
@@ -31,7 +31,7 @@ main(int argc, char *argv[])
sqlite3
*
db
;
sqlite3
*
db
;
bool
ret
=
true
;
bool
ret
=
true
;
lkt_config_t
conf
;
lkt_config_t
conf
;
char
kara_dir
[
PATH_MAX
],
*
db_path
;
char
kara_dir
[
PATH_MAX
],
*
db_path
,
*
mkvpropedit
;
struct
kara_metadata
data
;
struct
kara_metadata
data
;
struct
lkt_repo
repo
;
struct
lkt_repo
repo
;
...
@@ -45,6 +45,12 @@ main(int argc, char *argv[])
...
@@ -45,6 +45,12 @@ main(int argc, char *argv[])
return
1
;
return
1
;
}
}
/* In any case, we won't free the mkvpropedit, this is not a daemon. */
if
(
config_get_alloc
(
conf
,
"externals"
,
"mkvpropedit"
,
&
mkvpropedit
))
{
fprintf
(
stderr
,
" ! could not get the 'mkvpropedit property from the externals section
\n
'"
);
return
1
;
}
/* Arguments handle. */
/* Arguments handle. */
if
(
strcmp
(
argv
[
1
],
"--init"
)
==
0
)
{
if
(
strcmp
(
argv
[
1
],
"--init"
)
==
0
)
{
...
@@ -53,7 +59,7 @@ main(int argc, char *argv[])
...
@@ -53,7 +59,7 @@ main(int argc, char *argv[])
return
10
;
return
10
;
}
}
return
metadata_set_directory
(
kara_dir
);
return
metadata_set_directory
(
kara_dir
,
mkvpropedit
);
}
}
else
if
(
strcmp
(
argv
[
1
],
"--populate-all"
)
==
0
)
{
else
if
(
strcmp
(
argv
[
1
],
"--populate-all"
)
==
0
)
{
...
@@ -82,14 +88,14 @@ end_populate:
...
@@ -82,14 +88,14 @@ end_populate:
else
if
(
strcmp
(
argv
[
1
],
"--file"
)
==
0
)
{
else
if
(
strcmp
(
argv
[
1
],
"--file"
)
==
0
)
{
ret
=
0
;
ret
=
0
;
for
(
i
=
2
;
i
<
argc
;
++
i
)
for
(
i
=
2
;
i
<
argc
;
++
i
)
ret
|=
metadata_set_file
(
argv
[
i
]);
ret
|=
metadata_set_file
(
argv
[
i
]
,
mkvpropedit
);
return
ret
;
return
ret
;
}
}
else
if
(
strcmp
(
argv
[
1
],
"--prompt-file"
)
==
0
)
{
else
if
(
strcmp
(
argv
[
1
],
"--prompt-file"
)
==
0
)
{
ret
=
0
;
ret
=
0
;
for
(
i
=
2
;
i
<
argc
;
++
i
)
for
(
i
=
2
;
i
<
argc
;
++
i
)
ret
|=
metadata_set_file
(
argv
[
i
]);
ret
|=
metadata_set_file
(
argv
[
i
]
,
mkvpropedit
);
return
ret
;
return
ret
;
}
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/mkv/write.c
+
6
−
7
Voir le fichier @
1dc8deb6
...
@@ -53,8 +53,7 @@ static const char *METADATA_TEMPLATE =
...
@@ -53,8 +53,7 @@ static const char *METADATA_TEMPLATE =
" <String>%d</String> "
" <String>%d</String> "
" </Simple> "
" </Simple> "
" </Tag> "
" </Tag> "
" </Tags> "
" </Tags> "
;
;
static
bool
static
bool
mkvpropedit__
(
const
char
*
const
args
[])
mkvpropedit__
(
const
char
*
const
args
[])
...
@@ -248,7 +247,7 @@ error:
...
@@ -248,7 +247,7 @@ error:
}
}
int
int
metadata_set_directory
(
const
char
*
kara_dir
)
metadata_set_directory
(
const
char
*
kara_dir
,
const
char
*
mkvpropedit
)
{
{
DIR
*
d
;
DIR
*
d
;
struct
dirent
*
dir
;
struct
dirent
*
dir
;
...
@@ -271,12 +270,12 @@ metadata_set_directory(const char *kara_dir)
...
@@ -271,12 +270,12 @@ metadata_set_directory(const char *kara_dir)
if
(
dir
->
d_type
==
DT_REG
&&
if
(
dir
->
d_type
==
DT_REG
&&
metadata_from_path
(
path
,
&
meta
)
&&
metadata_from_path
(
path
,
&
meta
)
&&
kara_metadata_write
(
&
meta
,
path
,
"/usr/bin/
mkvpropedit
"
))
kara_metadata_write
(
&
meta
,
path
,
mkvpropedit
))
continue
;
continue
;
else
if
(
dir
->
d_type
==
DT_DIR
&&
else
if
(
dir
->
d_type
==
DT_DIR
&&
strcmp
(
dir
->
d_name
,
"."
)
!=
0
&&
strcmp
(
dir
->
d_name
,
"."
)
!=
0
&&
strcmp
(
dir
->
d_name
,
".."
)
!=
0
)
strcmp
(
dir
->
d_name
,
".."
)
!=
0
)
metadata_set_directory
(
path
);
metadata_set_directory
(
path
,
mkvpropedit
);
}
}
fprintf
(
stderr
,
" * metadata_set_directory: Passed directory '%s'
\n
"
,
kara_dir
);
fprintf
(
stderr
,
" * metadata_set_directory: Passed directory '%s'
\n
"
,
kara_dir
);
...
@@ -285,11 +284,11 @@ metadata_set_directory(const char *kara_dir)
...
@@ -285,11 +284,11 @@ metadata_set_directory(const char *kara_dir)
}
}
int
int
metadata_set_file
(
char
*
karapath
)
metadata_set_file
(
char
*
karapath
,
const
char
*
mkvpropedit
)
{
{
struct
kara_metadata
meta
;
struct
kara_metadata
meta
;
return
metadata_from_path
(
karapath
,
&
meta
)
&&
return
metadata_from_path
(
karapath
,
&
meta
)
&&
kara_metadata_write
(
&
meta
,
karapath
,
"/usr/bin/
mkvpropedit
"
);
kara_metadata_write
(
&
meta
,
karapath
,
mkvpropedit
);
}
}
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