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

Refactor FullDetailsFragment to use SDK #3591

Merged

Conversation

nielsvanvelzen
Copy link
Member

Changes

This PR updates the FullDetailsFragment to use the SDK for all non-livetv code. There's still 15 direct API calls left for Live TV. Will tackle those at some point in the future.

Some behavior changes had to be made because of some Live TV hacks (SeriesTimers is not a valid BaseItem type). Also some (small) cleaning done. Overall this file is a PITA to deal with as it tries to literally support all the item types we have.

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

play(episodes.items, 0, false)
} catch (err: ApiClientException) {

Check warning

Code scanning / detekt

The caught exception is swallowed. The original exception could be lost. Warning

The caught exception is swallowed. The original exception could be lost.
@@ -1466,12 +1351,13 @@
}

RecordPopup mRecordPopup;
public void showRecordingOptions(String id, final org.jellyfin.sdk.model.api.BaseItemDto program, final boolean recordSeries) {

public void showRecordingOptions(String id, final BaseItemDto program, final boolean recordSeries) {

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
@@ -1466,12 +1351,13 @@
}

RecordPopup mRecordPopup;
public void showRecordingOptions(String id, final org.jellyfin.sdk.model.api.BaseItemDto program, final boolean recordSeries) {

public void showRecordingOptions(String id, final BaseItemDto program, final boolean recordSeries) {

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

private DisplayMetrics mMetrics;

protected org.jellyfin.sdk.model.api.BaseItemDto mProgramInfo;
protected BaseItemDto mProgramInfo;

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
protected SeriesTimerInfoDto mSeriesTimerInfo;
protected UUID mItemId;
protected UUID mChannelId;
protected BaseRowItem mCurrentItem;
private Instant mLastUpdated;
private UUID mPrevItemId;
public UUID mPrevItemId;

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
@@ -257,11 +257,11 @@
staticHeight = true;
}

public ItemRowAdapter(Context context, BaseItemPerson[] people, Presenter presenter, MutableObjectAdapter<Row> parent) {
public ItemRowAdapter(List<BaseItemPerson> people, Context context, 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
@@ -257,11 +257,11 @@
staticHeight = true;
}

public ItemRowAdapter(Context context, BaseItemPerson[] people, Presenter presenter, MutableObjectAdapter<Row> parent) {
public ItemRowAdapter(List<BaseItemPerson> people, Context context, 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
@@ -257,11 +257,11 @@
staticHeight = true;
}

public ItemRowAdapter(Context context, BaseItemPerson[] people, Presenter presenter, MutableObjectAdapter<Row> parent) {
public ItemRowAdapter(List<BaseItemPerson> people, Context context, 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
@@ -257,11 +257,11 @@
staticHeight = true;
}

public ItemRowAdapter(Context context, BaseItemPerson[] people, Presenter presenter, MutableObjectAdapter<Row> parent) {
public ItemRowAdapter(List<BaseItemPerson> people, Context context, 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
@nielsvanvelzen nielsvanvelzen merged commit 135ccac into jellyfin:master May 20, 2024
5 checks passed
@nielsvanvelzen nielsvanvelzen deleted the sdk-fulldetailsfragment branch May 20, 2024 13:24
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