From: David ‘Bombe’ Roden Date: Sun, 17 Mar 2013 17:01:27 +0000 (+0100) Subject: Strip whitespace from artist and name. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=41d880358e59cd7b3b8c8d64f31e2f69990d3b8f;p=sonitus.git Strip whitespace from artist and name. --- 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); } //