fix setting metadata for certain tracks (#1507)
This commit is contained in:
@@ -33,9 +33,14 @@ public class FFMpeg {
|
||||
}
|
||||
|
||||
private static String setMetadata(MusicTrack track) {
|
||||
return Preferences.getBoolValue("setMetaData", false) ? " -metadata title=\"" + IOUtils.getValidFileName(M3UDownloader.getTitle(track)) + '"'
|
||||
+ " -metadata artist=\"" + normalizeMetadata(track.L.stream().map(Artist::w1).collect(Collectors.joining(", "))) + '"'
|
||||
+ " -metadata album=\"" + normalizeMetadata(track.I.getTitle()) + '"' : "";
|
||||
if (!Preferences.getBoolValue("setMetaData", false)) {
|
||||
return "";
|
||||
}
|
||||
return " -metadata title=\"" + IOUtils.getValidFileName(M3UDownloader.getTitle(track)) + '"'
|
||||
+ (track.L == null || track.I == null
|
||||
? " -metadata artist=\"" + normalizeMetadata(track.C) + '"'
|
||||
: " -metadata artist=\"" + normalizeMetadata(track.L.stream().map(Artist::w1).collect(Collectors.joining(", "))) + '"'
|
||||
+ " -metadata album=\"" + normalizeMetadata(track.I.getTitle()) + '"');
|
||||
}
|
||||
|
||||
private static String normalizeMetadata(String in) {
|
||||
|
||||
Reference in New Issue
Block a user