[job] add 'keywords-global' option (#6582)
https://github.com/mikf/gallery-dl/issues/6582#issuecomment-3505732704
This commit is contained in:
@@ -958,6 +958,17 @@ Description
|
||||
Additional name-value pairs to be added to each metadata dictionary.
|
||||
|
||||
|
||||
extractor.*.keywords-default
|
||||
----------------------------
|
||||
Type
|
||||
any
|
||||
Default
|
||||
``"None"``
|
||||
Description
|
||||
Default value used for missing or undefined keyword names in a
|
||||
`Format String`_.
|
||||
|
||||
|
||||
extractor.*.keywords-eval
|
||||
-------------------------
|
||||
Type
|
||||
@@ -969,15 +980,18 @@ Description
|
||||
as a `Format String`_.
|
||||
|
||||
|
||||
extractor.*.keywords-default
|
||||
----------------------------
|
||||
extractor.*.keywords-global
|
||||
---------------------------
|
||||
Type
|
||||
any
|
||||
Default
|
||||
``"None"``
|
||||
``object`` (`name` → `value`)
|
||||
Example
|
||||
``{"type": "Original", "type_id": 1, "type_category": "meta"}``
|
||||
Description
|
||||
Default value used for missing or undefined keyword names in a
|
||||
`Format String`_.
|
||||
Global name-value pairs to be added to each metadata dictionary.
|
||||
Note
|
||||
Keywords defined here will be overwritten by keywords from
|
||||
`extractor.keywords <extractor.*.keywords_>`__
|
||||
with the same name.
|
||||
|
||||
|
||||
extractor.*.metadata-url
|
||||
|
||||
@@ -52,8 +52,9 @@
|
||||
"chapter-unique": false,
|
||||
|
||||
"keywords" : {},
|
||||
"keywords-eval" : false,
|
||||
"keywords-default" : null,
|
||||
"keywords-eval" : false,
|
||||
"keywords-global" : {},
|
||||
|
||||
"parent-directory": false,
|
||||
"parent-metadata" : false,
|
||||
|
||||
@@ -87,6 +87,8 @@ class Job():
|
||||
"current_git_head": util.git_head()
|
||||
}
|
||||
# user-supplied metadata
|
||||
if kwdict := extr.config("keywords-global"):
|
||||
self.kwdict.update(kwdict)
|
||||
if kwdict := extr.config("keywords"):
|
||||
if extr.config("keywords-eval"):
|
||||
self.kwdict_eval = []
|
||||
|
||||
Reference in New Issue
Block a user