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

Migrate "next up" row to SDK #3624

Merged
merged 1 commit into from
May 30, 2024

Conversation

nielsvanvelzen
Copy link
Member

Changes

  • Use the SDK to retrieve "next up" requests for the home fragment and series details screens
  • Set enableResumable=false for home next up row to prevent episodes from showing in both the continue watching and next up rows
  • Add error handling to retrieveResumeItems in ItemRowAdapterHelper
  • Fix notifyRetrieveFinished never called in retrieveResumeItems in ItemRowAdapterHelper
  • Cry a lot

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 May 30, 2024
@nielsvanvelzen nielsvanvelzen added this to the v0.17.0 milestone May 30, 2024

// Some special flavor for series, used in FullDetailsFragment
val firstNextUp = response.items?.firstOrNull()
if (query.seriesId != null && response.items?.size == 1 && firstNextUp?.seasonId != null && firstNextUp.indexNumber != null) {

Check warning

Code scanning / detekt

Complex conditions should be simplified and extracted into well-named methods if necessary. Warning

This condition is too complex (4). Defined complexity threshold for conditions is set to '4'

// Some special flavor for series, used in FullDetailsFragment
val firstNextUp = response.items?.firstOrNull()
if (query.seriesId != null && response.items?.size == 1 && firstNextUp?.seasonId != null && firstNextUp.indexNumber != null) {

Check warning

Code scanning / detekt

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

Line detected, which is longer than the defined maximum line length in the code style.
@@ -97,7 +97,7 @@
this.changeTriggers = changeTriggers;
}

public BrowseRowDef(String header, NextUpQuery query) {
public BrowseRowDef(String header, GetNextUpRequest query) {

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -97,7 +97,7 @@
this.changeTriggers = changeTriggers;
}

public BrowseRowDef(String header, NextUpQuery query) {
public BrowseRowDef(String header, GetNextUpRequest query) {

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -110,7 +110,7 @@
this.queryType = QueryType.SeriesTimer;
}

public BrowseRowDef(String header, NextUpQuery query, ChangeTriggerType[] changeTriggers) {
public BrowseRowDef(String header, GetNextUpRequest query, ChangeTriggerType[] changeTriggers) {

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -110,7 +110,7 @@
this.queryType = QueryType.SeriesTimer;
}

public BrowseRowDef(String header, NextUpQuery query, ChangeTriggerType[] changeTriggers) {
public BrowseRowDef(String header, GetNextUpRequest query, ChangeTriggerType[] changeTriggers) {

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -110,7 +110,7 @@
this.queryType = QueryType.SeriesTimer;
}

public BrowseRowDef(String header, NextUpQuery query, ChangeTriggerType[] changeTriggers) {
public BrowseRowDef(String header, GetNextUpRequest query, ChangeTriggerType[] changeTriggers) {

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -221,7 +221,7 @@
return query;
}

public NextUpQuery getNextUpQuery() {
public GetNextUpRequest getNextUpQuery() {

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -227,12 +227,11 @@
queryType = QueryType.AlbumArtists;
}

public ItemRowAdapter(Context context, NextUpQuery query, boolean preferParentThumb, Presenter presenter, MutableObjectAdapter<Row> parent) {
public ItemRowAdapter(Context context, GetNextUpRequest query, boolean preferParentThumb, Presenter presenter, MutableObjectAdapter<Row> parent) {

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -227,12 +227,11 @@
queryType = QueryType.AlbumArtists;
}

public ItemRowAdapter(Context context, NextUpQuery query, boolean preferParentThumb, Presenter presenter, MutableObjectAdapter<Row> parent) {
public ItemRowAdapter(Context context, GetNextUpRequest query, boolean preferParentThumb, Presenter presenter, MutableObjectAdapter<Row> parent) {

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -227,12 +227,11 @@
queryType = QueryType.AlbumArtists;
}

public ItemRowAdapter(Context context, NextUpQuery query, boolean preferParentThumb, Presenter presenter, MutableObjectAdapter<Row> parent) {
public ItemRowAdapter(Context context, GetNextUpRequest query, boolean preferParentThumb, Presenter presenter, MutableObjectAdapter<Row> parent) {

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -227,12 +227,11 @@
queryType = QueryType.AlbumArtists;
}

public ItemRowAdapter(Context context, NextUpQuery query, boolean preferParentThumb, Presenter presenter, MutableObjectAdapter<Row> parent) {
public ItemRowAdapter(Context context, GetNextUpRequest query, boolean preferParentThumb, Presenter presenter, MutableObjectAdapter<Row> parent) {

Check notice

Code scanning / Android Lint

Unknown nullness Note

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

@thornbill thornbill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 lgtm assuming you don't care about the detekt warnings 😉

@nielsvanvelzen
Copy link
Member Author

The linters are suggestions 🙈

@nielsvanvelzen nielsvanvelzen merged commit 29da028 into jellyfin:master May 30, 2024
5 checks passed
@nielsvanvelzen nielsvanvelzen deleted the sdk-next-up branch May 30, 2024 20:45
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