aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2020-02-05 20:18:50 +0100
committerChristian Schneppe <christian.schneppe@pix-art.de>2020-02-05 20:20:47 +0100
commit1e5ebaa19c427adb68f3efa52eb5a9b521064132 (patch)
tree59419835b25fcd151699ecaa63f73dda6b2ea498 /src/main/java/de/pixart
parent0da5d84cf401c1064fb2e701aa214e05880e29c7 (diff)
limit artist - title in messages to 128 chars
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/FileBackend.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
index 08dc746c1..babc7f888 100644
--- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
@@ -1182,7 +1182,7 @@ public class FileBackend {
}
}
- private String getAudioTitleArtist(File file) {
+ private String getAudioTitleArtist(final File file) {
String artist;
String title;
StringBuilder builder = new StringBuilder();
@@ -1210,7 +1210,8 @@ public class FileBackend {
builder.append(title);
}
try {
- byte[] data = builder.toString().trim().getBytes("UTF-8");
+ final String s = builder.substring(0, Math.min(128, builder.length()));
+ final byte[] data = s.trim().getBytes("UTF-8");
return Base64.encodeToString(data, Base64.DEFAULT);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();