X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=nav2beet-local;fp=nav2beet-local;h=a25c5c5c638bbf271b7b3566b7c8128055c76b84;hb=72c18f3a6a7f1ed0ca16af654a1f804ab96e1ff9;hp=0000000000000000000000000000000000000000;hpb=3c7dab4936f011bb91f42f7ccb1f8432b94ea040;p=distro-setup diff --git a/nav2beet-local b/nav2beet-local new file mode 100755 index 0000000..a25c5c5 --- /dev/null +++ b/nav2beet-local @@ -0,0 +1,15 @@ +#!/bin/bash +set -e; . /usr/local/lib/err; set +e +source /a/bin/ds/beet-data + +for r in 1 2 3 4 5; do + sqlite3 /i/navidrome/navidrome.db ".output $r" "select path from annotation inner join media_file on item_id = id where rating = $r;" +done +find /i/m -type f -name '*.flac' >flacs +for plist in ${nav_tags[@]}; do + sqlite3 /i/navidrome/navidrome.db "select path from media_file inner join playlist_tracks on media_file.id = media_file_id where playlist_id = (select id from playlist where name = '_$plist');" | sed 's,^/i/converted,/i/m,' | sort >$plist +done +while read -r id name; do + mkdir -p 2genre/$id + sqlite3 /i/navidrome/navidrome.db "select path from media_file inner join playlist_tracks on media_file.id = media_file_id where playlist_id = '$id';" | sed 's,^/i/converted,/i/m,' | sort >2genre/$id/$name +done < <(sqlite3 /i/navidrome/navidrome.db ".separator ' '" "select id, name from playlist where name like '2%'")