diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-11-07 11:32:27 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-11-07 11:32:27 +0800 |
commit | 71ca28742ac4f93ab2401eaee8e78471c023cd4b (patch) | |
tree | dd7c3921d249151dc3179f015153b9f9833d9d73 /mpd/ncmpcpp/cover_obs.sh | |
parent | c7ed81e664a592db8fc9a9a6e8f44843de8024a1 (diff) |
Update
Diffstat (limited to 'mpd/ncmpcpp/cover_obs.sh')
-rwxr-xr-x | mpd/ncmpcpp/cover_obs.sh | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/mpd/ncmpcpp/cover_obs.sh b/mpd/ncmpcpp/cover_obs.sh deleted file mode 100755 index 032bd08..0000000 --- a/mpd/ncmpcpp/cover_obs.sh +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | COVER="/tmp/album_cover.png" | ||
4 | COVER_SIZE="400" | ||
5 | |||
6 | #path to current song | ||
7 | file="$MUSIC_DIR/$(mpc --format %file% current)" | ||
8 | album="${file%/*}" | ||
9 | #search for cover image | ||
10 | #use embedded image if present, otherwise take it from the current folder | ||
11 | err=$(ffmpeg -loglevel 16 -y -i "$file" -an -vcodec copy $EMB_COVER 2>&1) | ||
12 | if [ "$err" != "" ]; then | ||
13 | art=$(find "$album" -maxdepth 1 | grep -m 1 ".*\.\(jpg\|png\|gif\|bmp\)") | ||
14 | else | ||
15 | art=$EMB_COVER | ||
16 | fi | ||
17 | if [ "$art" = "" ]; then | ||
18 | art="$HOME/.ncmpcpp/default_cover.png" | ||
19 | fi | ||
20 | #copy and resize image to destination | ||
21 | ffmpeg -loglevel 0 -y -i "$art" -vf "scale=$COVER_SIZE:-1" "$COVER" \ No newline at end of file | ||