aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-01-13 09:30:09 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-01-13 09:30:09 -0300
commit71a5bbdbed854416ac84846474a242e39cd66b51 (patch)
treeea40776e1ca75a3565c89e7214c94c6939999b3e
parentcf4123328878d683bee0d458e3f1c50793cec9b2 (diff)
downloadplaylister-71a5bbdbed854416ac84846474a242e39cd66b51.tar.gz
playlister-71a5bbdbed854416ac84846474a242e39cd66b51.tar.bz2
Fix: playlist-copy: adb: update file list at the destination
-rwxr-xr-xplaylist-get18
1 files changed, 12 insertions, 6 deletions
diff --git a/playlist-get b/playlist-get
index 2d6426d..661eac9 100755
--- a/playlist-get
+++ b/playlist-get
@@ -59,6 +59,7 @@ else
action="get"
fi
+# Start
echo "Getting files from $PLAYLISTS/$PLAYLIST.m3u..."
cd $MEDIA
@@ -74,17 +75,22 @@ cat $PLAYLISTS/$PLAYLIST.m3u | while read file; do
prefix="/$(dirname "$file")"
echo mkdir -p \"$DEST$prefix\" | adb shell
$APP $action "$file" "$DEST$prefix"
-
- # Thanks https://stackoverflow.com/questions/17928576/refresh-android-mediastore-using-adb
- adb shell "find $DEST -exec am broadcast \
- -a android.intent.action.MEDIA_SCANNER_SCAN_FILE \
- -d file://{} \\;"
else
$APP $action "$file" $DEST
fi
done
-# Copy the playlist to the destination
+# Additional procedures
if [ "$action" != "get" ]; then
+ # Copy the playlist to the destination
$APP $action "$PLAYLISTS/$PLAYLIST.m3u" $DEST/$PLAYLIST.m3u
+
+ # Refresh file list at the destination
+ if [ "$APP" == "adb" ]; then
+ # Thanks https://stackoverflow.com/questions/17928576/refresh-android-mediastore-using-adb
+ echo "Updating file list at the destination..."
+ adb shell "find $DEST -exec am broadcast \
+ -a android.intent.action.MEDIA_SCANNER_SCAN_FILE \
+ -d file://{} \\;"
+ fi
fi