]> gitweb.fluxo.info Git - playlister.git/commitdiff
Feat: playlist-copy: adb: refresh mediastore
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 14 Dec 2023 00:12:49 +0000 (21:12 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 14 Dec 2023 00:12:49 +0000 (21:12 -0300)
playlist-get

index f1840612f543d9a643aa2f7d8f6df2f8813fd3f9..2d6426db50e7764dc75b5f96670b2315bf785a2c 100755 (executable)
@@ -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