From cf4123328878d683bee0d458e3f1c50793cec9b2 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Dec 2023 21:12:49 -0300 Subject: Feat: playlist-copy: adb: refresh mediastore --- playlist-get | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3