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

Fix blurry banners and thumbnails with fillWidth #3036

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

DoggoOfSpeed
Copy link
Contributor

Changes
Does the same as #2975 but with fillWidth

Issues
Fixes #2974

@@ -57,7 +57,7 @@
)
}

fun getPrimaryImageUrl(item: BaseItemDto, preferParentThumb: Boolean, maxHeight: Int): String {
fun getPrimaryImageUrl(item: BaseItemDto, preferParentThumb: Boolean, fillWidth: Int? = null, fillHeight: Int? = null): String {

Check warning

Code scanning / detekt

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

The function getPrimaryImageUrl appears to be too complex based on Cyclomatic Complexity (complexity: 18). Defined complexity threshold for methods is set to '15'
@@ -57,7 +57,7 @@
)
}

fun getPrimaryImageUrl(item: BaseItemDto, preferParentThumb: Boolean, maxHeight: Int): String {
fun getPrimaryImageUrl(item: BaseItemDto, preferParentThumb: Boolean, fillWidth: Int? = null, fillHeight: Int? = null): String {

Check warning

Code scanning / detekt

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.
@@ -82,9 +82,9 @@
return KoinJavaComponent.<ImageHelper>get(ImageHelper.class).getImageUrl(itemId, ModelCompat.asSdk(imageType), imageTag);
}

public static String getBannerImageUrl(org.jellyfin.sdk.model.api.BaseItemDto item, ApiClient apiClient, int maxHeight) {
public static String getBannerImageUrl(org.jellyfin.sdk.model.api.BaseItemDto item, ApiClient apiClient, int fillWidth, int fillHeight) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -82,9 +82,9 @@
return KoinJavaComponent.<ImageHelper>get(ImageHelper.class).getImageUrl(itemId, ModelCompat.asSdk(imageType), imageTag);
}

public static String getBannerImageUrl(org.jellyfin.sdk.model.api.BaseItemDto item, ApiClient apiClient, int maxHeight) {
public static String getBannerImageUrl(org.jellyfin.sdk.model.api.BaseItemDto item, ApiClient apiClient, int fillWidth, int fillHeight) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -82,9 +82,9 @@
return KoinJavaComponent.<ImageHelper>get(ImageHelper.class).getImageUrl(itemId, ModelCompat.asSdk(imageType), imageTag);
}

public static String getBannerImageUrl(org.jellyfin.sdk.model.api.BaseItemDto item, ApiClient apiClient, int maxHeight) {
public static String getBannerImageUrl(org.jellyfin.sdk.model.api.BaseItemDto item, ApiClient apiClient, int fillWidth, int fillHeight) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -105,9 +105,9 @@
return apiClient.GetImageUrl(item.getId().toString(), options);
}

public static String getThumbImageUrl(BaseItemDto item, ApiClient apiClient, int maxHeight) {
public static String getThumbImageUrl(BaseItemDto item, ApiClient apiClient, int fillWidth, int fillHeight) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -105,9 +105,9 @@
return apiClient.GetImageUrl(item.getId().toString(), options);
}

public static String getThumbImageUrl(BaseItemDto item, ApiClient apiClient, int maxHeight) {
public static String getThumbImageUrl(BaseItemDto item, ApiClient apiClient, int fillWidth, int fillHeight) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -105,9 +105,9 @@
return apiClient.GetImageUrl(item.getId().toString(), options);
}

public static String getThumbImageUrl(BaseItemDto item, ApiClient apiClient, int maxHeight) {
public static String getThumbImageUrl(BaseItemDto item, ApiClient apiClient, int fillWidth, int fillHeight) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -116,11 +116,11 @@
return apiClient.GetImageUrl(item.getId().toString(), options);
}

public static String getPrimaryImageUrl(@NonNull org.jellyfin.sdk.model.api.BaseItemDto item, @NonNull boolean preferParentThumb, @NonNull int maxHeight) {
return KoinJavaComponent.<ImageHelper>get(ImageHelper.class).getPrimaryImageUrl(item, preferParentThumb, maxHeight);
public static String getPrimaryImageUrl(@NonNull org.jellyfin.sdk.model.api.BaseItemDto item, boolean preferParentThumb, @Nullable Integer fillWidth, @Nullable Integer fillHeight) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
}

public static String getLogoImageUrl(@Nullable org.jellyfin.sdk.model.api.BaseItemDto item, @NonNull int maxWidth, @NonNull boolean useSeriesFallback) {
public static String getLogoImageUrl(@Nullable org.jellyfin.sdk.model.api.BaseItemDto item, int maxWidth, boolean useSeriesFallback) {

Check notice

Code scanning / Android Lint

Unknown nullness

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@nielsvanvelzen nielsvanvelzen added this to the v0.16.0 milestone Sep 19, 2023
@nielsvanvelzen nielsvanvelzen added the bug Something isn't working label Sep 19, 2023
@nielsvanvelzen nielsvanvelzen merged commit dec5b3a into jellyfin:master Sep 19, 2023
@nielsvanvelzen
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Banners and thumbnails fail to load required images
2 participants