Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > 13f5dcef5358e9d5a2a5a1ae6baf28fc > files > 164

gtkdialog-0.8.3-1.mga5.x86_64.rpm

#!/bin/sh

## Includes.
. functmpGet

## Set the first file found in the track's folder named
## cover.* as the cover otherwise use the default one.

funcCoverSet() {
	if [ -z "$BASH" ]; then local FUNCNAME=funcCoverSet; fi
	if [ $DEBUG_TRANSITS -ne 0 ]; then echo "$FUNCNAME: IN"; fi

	## Local variables.
	local playlisttrack="`functmpGet playlisttrack`"
	local cover trackdir

	if [ -n "$playlisttrack" ]; then
## 		trackdir="`dirname "$playlisttrack"`"	Redundant: builtin found.
		trackdir="${playlisttrack%/*}"
		## Make sure path is at least "/".
		case "$trackdir" in
			/*) true ;;
			*) trackdir=/"$trackdir" ;;
		esac
		cover="`ls \"$trackdir\"/$COVER_SEARCH_PATTERN 2> /dev/null | sed -n 1p`"
	fi
	if [ -z "$cover" ]; then
		cover=$PACKAGE_DATA_DIR/cover.png
	fi
	ln -sf "$cover" $TEMP_DIR/cover

	if [ $DEBUG_CONTENT -ne 0 ]; then echo "$FUNCNAME: cover=$cover"; fi

	if [ $DEBUG_TRANSITS -ne 0 ]; then echo "$FUNCNAME: OUT"; fi
}