Musish: xray script

master
Pierre Neidhardt 2014-01-17 12:16:56 +01:00
parent c3d680b349
commit 0a90b09a0f
2 changed files with 47 additions and 0 deletions

View File

@ -9,6 +9,9 @@ library_ext="/media/backup2/Musics"
use_colors=true
use_formatting=true
## Replace chars
tagsed="s/[´]/'/g; s/]/)/g; s/\[/(/g; s| *[/|\\:] *| - |g"
## French
constants="$constants un une de du le la les et mais pour ni ou à a où contre entre chez dans sur que qui "
## German

View File

@ -0,0 +1,44 @@
#!/bin/sh
## X-Ray Dog.
## Albums actually have years, but is it relevent since they have a code?
date=""
## Genre could be Soundtrack, or Trailer Music. We choose "" for now.
genre=""
## Extract album code, assuming parent folder is "XRCD## - $album".
XRCD="${FILENAME%/*}"
XRCD="${XRCD##*/}"
XRCD="${XRCD%% - *}"
## Append the album code to the constants array, other it will be capitalized.
constants="$constants $XRCD "
if [ -z "${album%%XRCD *}" ]; then
## Change "XRCD - ## - ..." -> "XRCD## - "
album="${album#XRCD}"
album="${album##*[0-9] }"
album="${album#-}"
album="$XRCD - $album"
elif [ -n "${album%%XRCD*}" ]; then
album="$XRCD - $album"
fi
if [ -z "${title}" ]; then
title="${FILENAME##*/}"
title="${title%.*}"
# title="$(echo "$title" | sed 's/X-Ray Dog//')"
title="$(echo "$title" | sed 's/X-Ray Dog\( \?- \?\)\?//')"
fi
if [ -z "${track}" ]; then
track="${title% *}"
title="${title#* }"
fi
subscript="$(findscript vorbis)"
if [ ! -f "$subscript" ]; then
_error "Subscript '$subscript' not found."
else
. "$subscript"
fi