aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2023-12-13 21:12:49 -0300
committerSilvio Rhatto <rhatto@riseup.net>2023-12-13 21:12:49 -0300
commitcf4123328878d683bee0d458e3f1c50793cec9b2 (patch)
tree2c1503fbdbd10f9df2cca45358723914abb62115
parent1d056e11c165704b0bfde1e536efc09a6efbf5d8 (diff)
downloadplaylister-cf4123328878d683bee0d458e3f1c50793cec9b2.tar.gz
playlister-cf4123328878d683bee0d458e3f1c50793cec9b2.tar.bz2
Feat: playlist-copy: adb: refresh mediastore
-rwxr-xr-xplaylist-get5
1 files changed, 5 insertions, 0 deletions
diff --git a/playlist-get b/playlist-get
index f184061..2d6426d 100755
--- a/playlist-get
+++ b/playlist-get
@@ -74,6 +74,11 @@ 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