#!/bin/bash

SOURCE="s3://suno-data/sara/persona_filter/minz_stems/"
DEST="s3://suno-data/sara/persona_filter/minz_cleaned_vox_stems/"

if [[ "$1" == "--dry-run" ]]; then
    echo "DRY RUN - Files that would be moved:"
    aws s3 ls "$SOURCE" --recursive | grep -E '_(vocals|vocal)\.opus$' | head -10
    echo "Total files: $(aws s3 ls "$SOURCE" --recursive | grep -c '_vocal')"
else
    echo "Moving vocal files..."
    aws s3 ls "$SOURCE" --recursive | \
    grep -E '_(vocals|vocal)\.opus$' | \
    awk '{print $4}' | \
    xargs -n 1 -P 50 -I {} bash -c 'aws s3 mv "s3://suno-data/{}" "'"$DEST"'$(basename {})"'
    echo "Done!"
fi