[export_meta][print_meta_flac] Can now detect changes with cover picture

This commit is contained in:
ayakael 2019-02-12 22:42:26 -05:00
parent 03a0321487
commit 0e41538ed3
No known key found for this signature in database
GPG key ID: DF4ED0DE242BD38A
2 changed files with 3 additions and 2 deletions

View file

@ -25,7 +25,7 @@ export_meta() {
local TRACKNO="$(print_mtag_trackno ${GIT_DIR} ${IMAGEID} ${trackid})" local TRACKNO="$(print_mtag_trackno ${GIT_DIR} ${IMAGEID} ${trackid})"
_msg ECHO "Checking ${trackid}" _msg ECHO "Checking ${trackid}"
## Path and metadata parsing ## Path and metadata parsing
local FUTURE_META="$(print_meta_mtag ${GIT_DIR}/${IMAGEID}.tags ${TRACKNO} | tr '\\' -d)" local FUTURE_META="$(print_meta_mtag ${GIT_DIR}/${IMAGEID}.tags ${TRACKNO} | tr '\\' -d);IMAGESIZE=$(du -sb ${GIT_DIR}/${IMAGEID}.jpg)"
local FUTURE_PATH="$(print_future_path ${FUTURE_META} | tr '"\:*?|<>' '________' )" local FUTURE_PATH="$(print_future_path ${FUTURE_META} | tr '"\:*?|<>' '________' )"
local PRESENT_PATH="$(print_present_path "${DB_FILE}" ${IMAGEID} ${trackid})" local PRESENT_PATH="$(print_present_path "${DB_FILE}" ${IMAGEID} ${trackid})"
local PRESENT_META="$(print_meta_flac "${TARGET}/${PRESENT_PATH}")" local PRESENT_META="$(print_meta_flac "${TARGET}/${PRESENT_PATH}")"

View file

@ -17,6 +17,7 @@ print_meta_flac() {
[[ ! -f ${file} ]] && return 1 [[ ! -f ${file} ]] && return 1
local METADATA=$(awk 'BEGIN{FS="]: ";ORS=";"}{if($1 ~ /comment\[/){print $2}}' <<< $(metaflac --list --block-type=VORBIS_COMMENT "${file}")) local METADATA=$(awk 'BEGIN{FS="]: ";ORS=";"}{if($1 ~ /comment\[/){print $2}}' <<< $(metaflac --list --block-type=VORBIS_COMMENT "${file}"))
echo ${METADATA} | sed 's|.$||' local PICTURE="IMAGESIZE=$(metaflac --list --block-type=PICTURE ${file} | awk 'BEGIN{FS=": ";RS="\n ";}{if($1=="data length"){print $2}}')"
echo ${METADATA}${PICTURE}
done done
} }