diff options
author | Francesco Minnocci | 2021-01-28 16:19:42 +0100 |
---|---|---|
committer | Francesco Minnocci | 2021-01-28 16:19:42 +0100 |
commit | 06e0518f48ce06187d1b69776b93466e2cf78254 (patch) | |
tree | 0fe7fc1029206d5f5e626fa1c8b8b30818b66d8f | |
parent | daf667bf0954766a3c343a84bc2f5d14312a7b26 (diff) | |
download | aur-06e0518f48ce06187d1b69776b93466e2cf78254.tar.gz |
Update exiftool patch (fix issue with naming of COVER file + cleanup)
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | exiftool.patch | 57 |
3 files changed, 34 insertions, 27 deletions
@@ -18,6 +18,6 @@ pkgbase = kunst-git source = git+https://github.com/sdushantha/kunst.git source = exiftool.patch sha256sums = SKIP - sha256sums = 86b3a1bd0ad87a9cb6a5466805a55ec87b2369c654eb492a7297fdaf51c068b7 + sha256sums = e157b0b3a1f48dc2805ba89b073315b3f9f095de6fdfeecfa00837f4aa8f7954 pkgname = kunst-git @@ -18,7 +18,7 @@ source=( ) sha256sums=( 'SKIP' - '86b3a1bd0ad87a9cb6a5466805a55ec87b2369c654eb492a7297fdaf51c068b7' + 'e157b0b3a1f48dc2805ba89b073315b3f9f095de6fdfeecfa00837f4aa8f7954' ) pkgver() { diff --git a/exiftool.patch b/exiftool.patch index 24ac55ec1cdf..6e56fc5bf7eb 100644 --- a/exiftool.patch +++ b/exiftool.patch @@ -1,5 +1,5 @@ ---- kunst/kunst 2021-01-28 15:37:59.000000000 +0100 -+++ kunst/kunst 2021-01-28 15:34:56.908337399 +0100 +--- kunst/kunst 2021-01-28 16:13:36.308318729 +0100 ++++ kunst/kunst 2021-01-28 16:17:06.101650374 +0100 @@ -8,7 +8,7 @@ @@ -9,17 +9,37 @@ MUSIC_DIR=~/Music/ SIZE=250x250 POSITION="+0+0" -@@ -138,7 +138,7 @@ +@@ -138,17 +138,32 @@ # Extract the album art from the mp3 file and dont show the messsy # output of ffmpeg - ffmpeg -i "$MUSIC_DIR$(mpc current -f %file%)" "$COVER" -y &> /dev/null -+ ffmpeg -i "$MUSIC_DIR/$(mpc current -f %file%)" "$COVER" -y &> /dev/null ++ if [ "$(type -p exiftool &>/dev/null)" ]; then ++ SONG="$MUSIC_DIR/$(mpc --format "%file%" current)" ++ PICTURE_TAG="-Picture" ++ ++ if [ "$SONG" = *".m4a" ]; then ++ PICTURE_TAG="-CoverArt" ++ fi ++ # Extract album cover using perl-image-exiftool ++ exiftool -b "$PICTURE_TAG" "$SONG" > "$COVER" ++ # Check if image is valid ++ img_data=$(identify "$COVER" 2>&1) ++ if [ "$img_data" = *"insufficient"* ]; then ++ return 1 ++ fi ++ else ++ ffmpeg -i "$MUSIC_DIR/$(mpc current -f %file%)" "$COVER" -y &> /dev/null ++ fi + +- # Get the status of the previous command +- STATUS=$? ++ STATUS=$? - # Get the status of the previous command - STATUS=$? -@@ -148,7 +148,7 @@ - [ ! "$SILENT" ] && echo "kunst: extracted album art" + # Check if the file has a embbeded album art + if [ "$STATUS" -eq 0 ];then +- [ ! "$SILENT" ] && echo "kunst: extracted album art" ++ [ ! "$SILENT" ] && echo "kunst: extracted album art" ARTLESS=false else - DIR="$MUSIC_DIR$(dirname "$(mpc current -f %file%)")" @@ -27,29 +47,16 @@ [ ! "$SILENT" ] && echo "kunst: inspecting $DIR" # Check if there is an album cover/art in the folder. -@@ -164,8 +164,19 @@ +@@ -164,7 +179,7 @@ fi if [ "$STATUS" -ne 0 ];then - [ ! "$SILENT" ] && echo "error: file does not have an album art" -- get_cover_online -+ if [ "$(command -v exiftool)" ]; then -+ SONG="$MUSIC_DIR/$(mpc --format "%file%" current)" -+ PICTURE_TAG="-Picture" -+ -+ if [ "$SONG" = *".m4a" ]; then -+ PICTURE_TAG="-CoverArt" -+ fi -+ # Extract album cover using perl-image-exiftool -+ exiftool -b "$PICTURE_TAG" "$SONG" > "$COVER" -+ else -+ [ ! "$SILENT" ] && echo "error: file does not have an album art" -+ get_cover_online -+ fi ++ [ ! "$SILENT" ] && echo "error: file does not have an album art" + get_cover_online fi } - -@@ -211,9 +222,6 @@ +@@ -211,9 +226,6 @@ update_cover if [ "$ARTLESS" == true ];then |