From: David ‘Bombe’ Roden Date: Sat, 28 Jul 2012 22:50:48 +0000 (+0200) Subject: Store original extension. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6862399e0ca713709b31e9f196fd5e0d80114f05;p=demoscenemusic.git Store original extension. --- 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. */