From ebf47b80757e968984d4c197f5f948d575f150fe Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Sun, 1 Mar 2020 01:37:46 -0800 Subject: [PATCH 1/2] Use better regex to find cover art Allow the cover filename to be preceeded by a track number, which sometimes happens with certain programs and ripping setups. --- kunst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kunst b/kunst index 8fa3186..cc33409 100755 --- a/kunst +++ b/kunst @@ -161,7 +161,7 @@ update_cover() { # use same regex to find album art as mpDris2 candidates=$( find "$DIR" -type f \ - | grep -iE '/(album|cover|\.?folder|front).*\.(gif|jpeg|jpg|png)' + | grep -iE '/(([0-9| |-]*)?)(album|cover|\.?folder|front).*\.(gif|jpeg|jpg|png)' ) while read -r CANDIDATE; do if [ -f "$CANDIDATE" ]; then From e3a60593cb22ff61ec8d49e05a0f11378dcd7223 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Sun, 1 Mar 2020 01:45:14 -0800 Subject: [PATCH 2/2] Cover file regex: file extension should be at EOL File extensions (.png, .jpg, etc) should come at the end of the line. mpDris2 also includes an EOL in its regex pattern: see line 108 in https://github.com/eonpatapon/mpDris2/blob/491588a476adfb6923800bbc9f0aa66a0fd6a380/src/mpDris2.in.py#L108 --- kunst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kunst b/kunst index cc33409..a2d4a61 100755 --- a/kunst +++ b/kunst @@ -161,7 +161,7 @@ update_cover() { # use same regex to find album art as mpDris2 candidates=$( find "$DIR" -type f \ - | grep -iE '/(([0-9| |-]*)?)(album|cover|\.?folder|front).*\.(gif|jpeg|jpg|png)' + | grep -iE '/(([0-9| |-]*)?)(album|cover|\.?folder|front).*\.(gif|jpeg|jpg|png)$' ) while read -r CANDIDATE; do if [ -f "$CANDIDATE" ]; then