mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Add audio track locale info.
This commit is contained in:
parent
8596211445
commit
32db19956b
2 changed files with 7 additions and 3 deletions
|
@ -10,6 +10,7 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamType;
|
import org.schabi.newpipe.extractor.stream.StreamType;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import static me.kavin.piped.utils.URLUtils.*;
|
import static me.kavin.piped.utils.URLUtils.*;
|
||||||
|
@ -54,7 +55,8 @@ public class CollectionUtils {
|
||||||
String.valueOf(stream.getFormat()), stream.getAverageBitrate() + " kbps",
|
String.valueOf(stream.getFormat()), stream.getAverageBitrate() + " kbps",
|
||||||
stream.getFormat().getMimeType(), false, stream.getBitrate(), stream.getInitStart(),
|
stream.getFormat().getMimeType(), false, stream.getBitrate(), stream.getInitStart(),
|
||||||
stream.getInitEnd(), stream.getIndexStart(), stream.getIndexEnd(), stream.getCodec(), stream.getAudioTrackId(), stream.getAudioTrackName(),
|
stream.getInitEnd(), stream.getIndexStart(), stream.getIndexEnd(), stream.getCodec(), stream.getAudioTrackId(), stream.getAudioTrackName(),
|
||||||
Optional.ofNullable(stream.getAudioTrackType()).map(Enum::name).orElse(null)
|
Optional.ofNullable(stream.getAudioTrackType()).map(Enum::name).orElse(null),
|
||||||
|
Optional.ofNullable(stream.getAudioLocale()).map(Locale::toLanguageTag).orElse(null)
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import lombok.NoArgsConstructor;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class PipedStream {
|
public class PipedStream {
|
||||||
|
|
||||||
public String url, format, quality, mimeType, codec, audioTrackId, audioTrackName, audioTrackType;
|
public String url, format, quality, mimeType, codec, audioTrackId, audioTrackName, audioTrackType, audioTrackLocale;
|
||||||
public boolean videoOnly;
|
public boolean videoOnly;
|
||||||
|
|
||||||
public int bitrate, initStart, initEnd, indexStart, indexEnd, width, height, fps;
|
public int bitrate, initStart, initEnd, indexStart, indexEnd, width, height, fps;
|
||||||
|
@ -19,7 +19,8 @@ public class PipedStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PipedStream(String url, String format, String quality, String mimeType, boolean videoOnly, int bitrate,
|
public PipedStream(String url, String format, String quality, String mimeType, boolean videoOnly, int bitrate,
|
||||||
int initStart, int initEnd, int indexStart, int indexEnd, String codec, String audioTrackId, String audioTrackName, String audioTrackType) {
|
int initStart, int initEnd, int indexStart, int indexEnd, String codec, String audioTrackId,
|
||||||
|
String audioTrackName, String audioTrackType, String audioTrackLocale) {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.format = format;
|
this.format = format;
|
||||||
this.quality = quality;
|
this.quality = quality;
|
||||||
|
@ -34,6 +35,7 @@ public class PipedStream {
|
||||||
this.audioTrackId = audioTrackId;
|
this.audioTrackId = audioTrackId;
|
||||||
this.audioTrackName = audioTrackName;
|
this.audioTrackName = audioTrackName;
|
||||||
this.audioTrackType = audioTrackType;
|
this.audioTrackType = audioTrackType;
|
||||||
|
this.audioTrackLocale = audioTrackLocale;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PipedStream(String url, String format, String quality, String mimeType, boolean videoOnly, int bitrate,
|
public PipedStream(String url, String format, String quality, String mimeType, boolean videoOnly, int bitrate,
|
||||||
|
|
Loading…
Reference in a new issue