Add more info to captions.

This commit is contained in:
FireMasterK 2021-04-21 19:52:58 +05:30
parent 179025af7e
commit 2139b1431b
No known key found for this signature in database
GPG key ID: 8DFF5DD33E93DB58
2 changed files with 11 additions and 5 deletions

View file

@ -81,8 +81,10 @@ public class ResponseHelper {
final StreamInfo info = futureStream.get(10, TimeUnit.SECONDS);
// System.out.println(Constants.mapper.writeValueAsString(info.getStreamSegments()));
info.getSubtitles().forEach(subtitle -> subtitles
.add(new Subtitle(rewriteURL(subtitle.getUrl()), subtitle.getFormat().getMimeType())));
info.getSubtitles()
.forEach(subtitle -> subtitles.add(new Subtitle(rewriteURL(subtitle.getUrl()),
subtitle.getFormat().getMimeType(), subtitle.getDisplayLanguageName(),
subtitle.getLanguageTag(), subtitle.isAutoGenerated())));
final List<PipedStream> videoStreams = new ObjectArrayList<>();
final List<PipedStream> audioStreams = new ObjectArrayList<>();

View file

@ -2,10 +2,14 @@ package me.kavin.piped.utils.obj;
public class Subtitle {
public final String url, mimeType;
public final String url, mimeType, name, code;
public final boolean autoGenerated;
public Subtitle(String url, String mimeType) {
public Subtitle(String url, String mimeType, String name, String code, boolean autoGenerated) {
this.url = url;
this.mimeType = mimeType;
};
this.name = name;
this.code = code;
this.autoGenerated = autoGenerated;
}
}