From 6862399e0ca713709b31e9f196fd5e0d80114f05 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 29 Jul 2012 00:50:48 +0200 Subject: [PATCH] Store original extension. --- .../demoscenemusic/page/admin/AddTrackDerivativePage.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/page/admin/AddTrackDerivativePage.java b/src/main/java/net/pterodactylus/demoscenemusic/page/admin/AddTrackDerivativePage.java index 2a80f78..91ab832 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/page/admin/AddTrackDerivativePage.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/page/admin/AddTrackDerivativePage.java @@ -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. */ -- 2.7.4