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

Replace most utils with SDK #2014

Merged
merged 1 commit into from
Aug 27, 2022
Merged

Conversation

nielsvanvelzen
Copy link
Member

Changes

  • Replace most utils with SDK

Issues

@nielsvanvelzen nielsvanvelzen added sdk-migration To fix this we need to migrate some code to the new SDK refactor Improvements to code realiability, readability and quality labels Aug 27, 2022
@nielsvanvelzen nielsvanvelzen added this to the v0.15.0 milestone Aug 27, 2022
else -> name
}

fun BaseItemDto.getSubName(context: Context): String? = when (type) {

Check notice

Code scanning

Prefer splitting up complex methods into smaller, easier to understand methods.

The function getSubName appears to be too complex (20). Defined complexity threshold for methods is set to '15'
fun BaseItemDto.isLiveTv() = type == BaseItemKind.PROGRAM || type == BaseItemKind.LIVE_TV_CHANNEL
fun BaseItemDto.isNew() = isSeries == true && isNews != true && isRepeat != true

fun BaseItemDto.getProgramUnknownChannelName(): String? = TvManager.getChannel(TvManager.getAllChannelsIndex(channelId?.toString())).name

Check notice

Code scanning

Line detected, which is longer than the defined maximum line length in the code style.

Line detected, which is longer than the defined maximum line length in the code style.
@nielsvanvelzen nielsvanvelzen merged commit 11193c7 into jellyfin:master Aug 27, 2022
@nielsvanvelzen nielsvanvelzen deleted the sdk-utils branch August 27, 2022 18:49
layout.addView(name);
}

private static void addProgramInfo(@NonNull Context context, BaseItemDto item, LinearLayout layout) {
TextView name = new TextView(context);
name.setTextSize(textSize);
name.setText(BaseItemUtils.getProgramSubText(item, context)+" ");
name.setText(BaseItemExtensionsKt.getProgramSubText(item, context)+" ");

Check warning

Code scanning / Android Lint

TextView Internationalization

Do not concatenate text displayed with setText. Use resource string with placeholders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Improvements to code realiability, readability and quality sdk-migration To fix this we need to migrate some code to the new SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants