fix: audio stream cache key, code fmt
This commit is contained in:
parent
4e837e838d
commit
22671ca16c
4 changed files with 12 additions and 6 deletions
|
@ -470,9 +470,7 @@ public class DownloadDialog extends DialogFragment
|
||||||
dialogBinding.audioTrackSpinner.setVisibility(
|
dialogBinding.audioTrackSpinner.setVisibility(
|
||||||
isVideoOnly && wrappedAudioTracks.size() > 1 ? View.VISIBLE : View.GONE);
|
isVideoOnly && wrappedAudioTracks.size() > 1 ? View.VISIBLE : View.GONE);
|
||||||
dialogBinding.defaultAudioTrackPresentText.setVisibility(
|
dialogBinding.defaultAudioTrackPresentText.setVisibility(
|
||||||
!isVideoOnly && wrappedAudioTracks.size() > 1 ? View.VISIBLE : View.GONE
|
!isVideoOnly && wrappedAudioTracks.size() > 1 ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupSubtitleSpinner() {
|
private void setupSubtitleSpinner() {
|
||||||
|
|
|
@ -161,6 +161,11 @@ public interface PlaybackResolver extends Resolver<StreamInfo, MediaSource> {
|
||||||
cacheKey.append(audioStream.getAudioTrackId());
|
cacheKey.append(audioStream.getAudioTrackId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (audioStream.getAudioLocale() != null) {
|
||||||
|
cacheKey.append(" ");
|
||||||
|
cacheKey.append(audioStream.getAudioLocale().getISO3Language());
|
||||||
|
}
|
||||||
|
|
||||||
return cacheKey.toString();
|
return cacheKey.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -797,7 +797,8 @@ public final class ListHelper {
|
||||||
* @return Comparator
|
* @return Comparator
|
||||||
*/
|
*/
|
||||||
static Comparator<AudioStream> getAudioTrackComparator(
|
static Comparator<AudioStream> getAudioTrackComparator(
|
||||||
final Locale preferredLanguage, final boolean preferOriginalAudio,
|
final Locale preferredLanguage,
|
||||||
|
final boolean preferOriginalAudio,
|
||||||
final boolean preferDescriptiveAudio) {
|
final boolean preferDescriptiveAudio) {
|
||||||
final String langCode = preferredLanguage.getISO3Language();
|
final String langCode = preferredLanguage.getISO3Language();
|
||||||
final List<AudioTrackType> trackTypeRanking = preferDescriptiveAudio
|
final List<AudioTrackType> trackTypeRanking = preferDescriptiveAudio
|
||||||
|
|
|
@ -451,8 +451,10 @@ public class ListHelperTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AudioStream generateAudioTrack(
|
private static AudioStream generateAudioTrack(
|
||||||
@NonNull final String id, @Nullable final String trackId,
|
@NonNull final String id,
|
||||||
@Nullable final Locale locale, @Nullable final AudioTrackType trackType) {
|
@Nullable final String trackId,
|
||||||
|
@Nullable final Locale locale,
|
||||||
|
@Nullable final AudioTrackType trackType) {
|
||||||
return new AudioStream.Builder()
|
return new AudioStream.Builder()
|
||||||
.setId(id)
|
.setId(id)
|
||||||
.setContent("", true)
|
.setContent("", true)
|
||||||
|
|
Loading…
Reference in a new issue