Store original extension.
[demoscenemusic.git] / src / main / java / net / pterodactylus / demoscenemusic / page / admin / AddTrackDerivativePage.java
index 2a80f78..91ab832 100644 (file)
@@ -119,6 +119,9 @@ public class AddTrackDerivativePage extends AdminBasePage {
                                        /* okay, we’re here, so everything’s fine, probably. */
                                        TrackDerivative derivative = getCore().getDataManager().createTrackDerivative(track);
                                        derivative.getProperties().set("file/original-name", filename);
+                                       if (filename.indexOf('.') > filename.lastIndexOf('/')) {
+                                               derivative.getProperties().set("file/extension", filename.substring(filename.lastIndexOf('.') + 1));
+                                       }
                                        getCore().getDataManager().saveTrackDerivate(derivative);
 
                                        /* copy the file again. */