[export_meta][print_meta_flac] Can now detect changes with cover picture
This commit is contained in:
parent
03a0321487
commit
0e41538ed3
2 changed files with 3 additions and 2 deletions
|
@ -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}")"
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue