From e5beb1476a7228563b4c182e06b5f6fd793bcf3d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 6 Sep 2024 16:43:10 -0300 Subject: Fix: playlister: support for checking on arbitrary folders --- playlist-orphans | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'playlist-orphans') diff --git a/playlist-orphans b/playlist-orphans index c66bd93..cb103d2 100755 --- a/playlist-orphans +++ b/playlist-orphans @@ -34,7 +34,7 @@ function playlist_orphan { function playlist_orphans { local cwd="`pwd`" - cd $MEDIA + #cd $MEDIA if [ ! -z "$FILE" ]; then playlist_orphan $FILE @@ -46,24 +46,26 @@ function playlist_orphans { done fi - cd $cwd + #cd $cwd } # Basic syntax check if [ "$ITEM" == "--help" ]; then echo "Usage: $BASENAME [file|folder]" + echo "" + echo "Example: $basename /path/to/some/media/files/" exit 1 fi # Determine items if [ ! -z "$ITEM" ]; then - if [ -d "$MEDIA/$ITEM" ]; then - FOLDER="$MEDIA/$ITEM" - elif [ -e "$MEDIA/$ITEM" ] || [ -L "$MEDIA/$ITEM" ]; then - FILE="$MEDIA/$ITEM" + if [ -d "$ITEM" ]; then + FOLDER="$ITEM" + elif [ -e "$ITEM" ] || [ -L "$ITEM" ]; then + FILE="$ITEM" else - echo "$BASENAME: error: item not found: $MEDIA/$ITEM" + echo "$BASENAME: error: item not found: $ITEM" exit 1 fi else -- cgit v1.2.3