X-Git-Url: http://git.plutz.net/?p=serve0;a=blobdiff_plain;f=list.sh;h=a4bdbc797490d31e68700e559476dcc8d02e4319;hp=30dfc42977d7c9c1aa1852d7683a94e40dca2bff;hb=608e267413cf7f8399cacbbfc4269d3c3820a3aa;hpb=669103393f336de7895ff366af54da56f4192b4d diff --git a/list.sh b/list.sh index 30dfc42..a4bdbc7 100644 --- a/list.sh +++ b/list.sh @@ -88,15 +88,18 @@ list_filter(){ } groupmatch(){ - if [ ${#1} -gt ${#2} ]; then - long="$1" short="$2" - else - long="$2" short="$1" - fi + a="${1%$CR}" b="${2%$CR}" +# if [ ${#a} -gt ${#b} ]; then +# long="$a" short="$b" +# else +# long="$b" short="$a" +# fi # com="$(expr substr "$long" 1 $((${#long} * 3 / 4)))" - com="$(expr substr "$long" 1 $((${#long} - 3)))" - cut="${short#$com}" - if [ ${#cut} -lt ${#short} ]; then + # com="$(expr substr "$long" 1 $((${#long} - 3)))" + ## Cut off youtube- and other site suffixes. Cut of last three characters + com="$(printf %s "$a" |sed -E 's;-([0-9a-zA-Z_-]{11}|ph[0-9a-f]{13}|[0-9]{8})$;;; s;...$;;;')" + cut="${b#$com}" + if [ "${cut}" != "${b}" ]; then return 0 else return 1 @@ -107,7 +110,7 @@ list_order(){ local fm fn fn al length ln h w t c name buffer l if [ $ORDER = Name ]; then - sort -n -k6 |sed 's;^;metashort\t;;' + sort -k6 |sed 's;^;metashort\t;;' elif [ $ORDER = Group ]; then { sort -k6; echo '0 0 0 tags= comment= _'; } \ | while read -r length h w t c name; do