dot

packages and services management
Log | Files | Refs | README

commit f5bc96b0acd73bb7bf3b470d7fda38a210861780
parent 8f89545ac116dcef622b38db246b60f131e96556
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 23 Feb 2018 11:58:40 +0100

mv-groupdir: to group albums together

Diffstat:
Mbin/mv-flac | 2+-
Abin/mv-groupdir | 17+++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/bin/mv-flac b/bin/mv-flac @@ -7,7 +7,7 @@ # Grab the year out of some string y() { - sed 's/.*([0-9]{4}).*/\1/' + sed -r 's/.*([0-9]{4}).*/\1/' } # Grab the value out of a key=value pair diff --git a/bin/mv-groupdir b/bin/mv-groupdir @@ -0,0 +1,17 @@ +#!/bin/sh -e + +# usage: mv-groupdir + +# Group all common sub-subdirectories. This changes all subdirectories +# into "d". It is useful to group multi-artist albums together: +# ./artis1/album1 -> d/album1 +# ./artis2/album1 -> d/album1 +# ./artis3/album1 -> d/album1 +# ./artis4/album2 -> d/album2 +# ./artis5/album2 -> d/album2 + +mkdir d + +for dir in */* +do + mkdir -p "d/${dir#*/}"; ln -s "$dir"/* "d/${dir#*/}"; done