From 41d880358e59cd7b3b8c8d64f31e2f69990d3b8f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 17 Mar 2013 18:01:27 +0100 Subject: [PATCH] Strip whitespace from artist and name. --- src/main/java/net/pterodactylus/sonitus/data/Metadata.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sonitus/data/Metadata.java b/src/main/java/net/pterodactylus/sonitus/data/Metadata.java index f4f0ede..cb1864f 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/Metadata.java +++ b/src/main/java/net/pterodactylus/sonitus/data/Metadata.java @@ -160,7 +160,7 @@ public class Metadata { * @return New metadata with a changed artist */ public Metadata artist(String artist) { - return new Metadata(channels, frequency, encoding, artist, name.orNull()); + return new Metadata(channels, frequency, encoding, (artist != null) ? artist.trim() : artist, name.orNull()); } /** @@ -181,7 +181,7 @@ public class Metadata { * @return New metadata with a changed name */ public Metadata name(String name) { - return new Metadata(channels, frequency, encoding, artist.orNull(), name); + return new Metadata(channels, frequency, encoding, artist.orNull(), (name != null) ? name.trim() : name); } // -- 2.7.4