]> gitweb.fluxo.info Git - playlister.git/commitdiff
Fix: playlister: support for checking on arbitrary folders
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 6 Sep 2024 19:43:10 +0000 (16:43 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 6 Sep 2024 19:43:10 +0000 (16:43 -0300)
playlist-orphans

index c66bd933867cf43ccf44b3eb5ba5ddff90da0ad3..cb103d23a24476abafb8f0ab58026a14e897c678 100755 (executable)
@@ -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