Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Video Codec Tag #2245

Merged
merged 1 commit into from
Nov 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,10 @@ private static void addRatingAndRes(Context context, BaseItemDto item, LinearLay
addBlockText(context, layout, "8K");
}

addSpacer(context, layout, " ");
addSpacer(context, layout, " ");

addVideoCodecDetails(context, layout, item.getMediaStreams().get(0));

}
if (Utils.isTrue(item.getHasSubtitles())) {
addBlockText(context, layout, "CC");
Expand All @@ -363,6 +366,16 @@ private static void addSeriesStatus(Context context, BaseItemDto item, LinearLay
}
}

private static void addVideoCodecDetails(Context context, LinearLayout layout, MediaStream stream) {
if (stream != null) {
if (stream.getCodec() != null && stream.getCodec().trim().length() > 0) {
String codec = stream.getCodec().toUpperCase();

Check warning

Code scanning / Android Lint

Implied default locale in case conversion

Implicitly using the default locale is a common source of bugs: Use toUpperCase(Locale) instead. For strings meant to be internal use Locale.ROOT, otherwise Locale.getDefault().
addBlockText(context, layout, codec);
addSpacer(context, layout, " ");
}
}
}

private static void addMediaDetails(Context context, MediaStream stream, LinearLayout layout) {

if (stream != null) {
Expand Down