[db_update] Fixed typo where all existing TRACKIDs would be reported as deleted when it really wasnt

This commit is contained in:
ayakael 2018-04-08 13:00:23 -04:00
parent a9c9e80c06
commit d9adfac99f
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026

View file

@ -18,7 +18,7 @@ db_update() {
[[ -f "${DB_FILE}" ]] || touch "${DB_FILE}"
trackidList=($(awk 'BEGIN{FS="\" : \"";RS="\",\n * \""}{if($1=="TRACKID"){print $2}}' ${GIT_DIR}/${IMAGEID}.tags))
if [[ -f ${GIT_DIR}/${IMAGEID}.tags ]]; then
if [[ ! -f ${GIT_DIR}/${IMAGEID}.tags ]]; then
_msg ECHO "Removing ${IMAGEID} from database file"
gawk -i inplace -v imageid="${IMAGEID}" 'BEGIN{FS="\t";OFS="\t"}{if($2=imageid){$1="null"}{print $0}}' ${DB_FILE}
continue