Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
postprocessing
Media Metadata Indexer
Commits
8556a098
Unverified
Commit
8556a098
authored
Dec 18, 2020
by
Sebastian Schüpbach
Browse files
use %s as substitute
parent
8aaae55f
Pipeline
#19208
passed with stages
in 1 minute and 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mediametadatatodb_app/resources/indexer.py
View file @
8556a098
...
...
@@ -44,8 +44,8 @@ class Indexer:
db_values
=
[
record
[
f
]
for
f
in
fields
if
f
in
record
and
record
[
f
]]
db_values
.
extend
([
record
[
f
]
for
f
in
fields
if
f
!=
'sig'
and
f
in
record
and
record
[
f
]])
db_fields
=
','
.
join
([
f
for
f
in
fields
if
f
in
record
and
record
[
f
]])
db_value_placeholders
=
', '
.
join
([
'
?
'
for
f
in
fields
if
f
in
record
and
record
[
f
]])
key_value
=
", "
.
join
([
f
"
{
f
}
=
?
"
for
f
in
fields
db_value_placeholders
=
', '
.
join
([
'
%s
'
for
f
in
fields
if
f
in
record
and
record
[
f
]])
key_value
=
", "
.
join
([
f
"
{
f
}
=
%s
"
for
f
in
fields
if
f
!=
'sig'
and
f
in
record
and
record
[
f
]])
# noinspection SqlNoDataSourceInspection
return
'INSERT INTO {} ({}) VALUES ({}) ON DUPLICATE KEY UPDATE {}'
.
format
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment