import net.pterodactylus.demoscenemusic.data.Track;
import net.pterodactylus.demoscenemusic.data.TrackDerivative;
import net.pterodactylus.demoscenemusic.page.ServletRequest;
+import net.pterodactylus.demoscenemusic.utils.AudioCodecs;
+import net.pterodactylus.demoscenemusic.utils.AudioCodecs.AudioCodecDescription;
import net.pterodactylus.util.database.DatabaseException;
import net.pterodactylus.util.io.Closer;
import net.pterodactylus.util.io.StreamCopier;
if (filename.indexOf('.') > filename.lastIndexOf('/')) {
derivative.getProperties().set("file/extension", filename.substring(filename.lastIndexOf('.') + 1));
}
+ AudioCodecDescription audioCodecDescription = AudioCodecs.detect(filename);
+ if (audioCodecDescription != null) {
+ derivative.getProperties().set("audio/codec", audioCodecDescription.code);
+ }
/* TODO - identify file type and media information */
getCore().getDataManager().saveTrackDerivate(derivative);