Skip to content

Commit d658b22

Browse files
committed
cover-updater: Fix path
1 parent cc85bcd commit d658b22

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

apps/cover-updater/scripts/process-covers.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ processImage() {
8585
local path=$2
8686
local thread_id=$3
8787

88-
output=${DOWNLOAD_DIR_TMP}/cover_${id}.jpg
8988
path=$(echo ${path} | tr -d '\r' | tr -d '\n')
9089
log="\n[Thread $thread_id] id: $id, path: $path\n"
9190

@@ -94,20 +93,18 @@ processImage() {
9493
else
9594
log=${log}"[Thread $thread_id] Image doesn't exist locally: ${path}\n"
9695
addQueryToSqlList ${thread_id} "$(getCoverLogInsertErrorQuery ${id} "Failed to download")"
97-
rm -f ${output}
9896
echo -e ${log}
9997
return
10098
fi
10199

102-
PASTEC_OUTPUT=$(curl -s -S -X PUT --data-binary @${output} http://${PASTEC_HOST}:${PASTEC_PORT}/index/images/${id})
100+
PASTEC_OUTPUT=$(curl -s -S -X PUT --data-binary @${path} http://${PASTEC_HOST}:${PASTEC_PORT}/index/images/${id})
103101
if [[ ${PASTEC_OUTPUT} == *"IMAGE_ADDED"* ]]; then
104102
log=${log}"[Thread $thread_id] Imported\n"
105103
addQueryToSqlList ${thread_id} "$(getCoverLogInsertSuccessQuery ${id})"
106104
else
107105
log=${log}"[Thread $thread_id] Failed to import : $PASTEC_OUTPUT\n"
108106
addQueryToSqlList ${thread_id} "$(getCoverLogInsertErrorQuery ${id} ${PASTEC_OUTPUT})"
109107
fi
110-
rm -f ${output}
111108
echo -e ${log}
112109
}
113110

0 commit comments

Comments
 (0)