limit artist - title in messages to 128 chars

This commit is contained in:
Christian Schneppe 2020-02-05 20:18:50 +01:00
parent 0da5d84cf4
commit 1e5ebaa19c
No known key found for this signature in database
GPG key ID: F30B8D686B44D87E

View file

@ -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();