package leigh.perfect;

import leigh.mecha.audio.AudioFileProcessor;
import leigh.mecha.audio.AudioScanner;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.Connection;

/**
 * Load raw files into the audio database.
 *
 * @author Alex Leigh
 */
public class PerfectLoader {
    public static void main(String args[]) throws Exception {
        try(Connection con = PerfectDatasource.getDataSource().getConnection()) {
            AudioScanner scanner = new AudioScanner();
            scanner.defaultSupported();

           // try(PreparedStatement ps = con.prepareStatement(""INSERT INTO load_t ()))

            scanner.scan(Paths.get(args[0]), new AudioFileProcessor() {
                @Override
                public void process(Path file, String artist, String album, String title, int length, long bitrate) {

                }
            });
        }
        }


}
