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

Remove unnecessary methods. #8663

Merged
merged 2 commits into from
Jul 23, 2022
Merged
Show file tree
Hide file tree
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 @@ -578,17 +578,13 @@ private void showContentNotSupportedIfNeeded() {
}

private PlayQueue getPlayQueue() {
return getPlayQueue(0);
}

private PlayQueue getPlayQueue(final int index) {
final List<StreamInfoItem> streamItems = infoListAdapter.getItemsList().stream()
.filter(StreamInfoItem.class::isInstance)
.map(StreamInfoItem.class::cast)
.collect(Collectors.toList());

return new ChannelPlayQueue(currentInfo.getServiceId(), currentInfo.getUrl(),
currentInfo.getNextPage(), streamItems, index);
currentInfo.getNextPage(), streamItems, 0);
}

/*//////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void onSuccess(@NonNull final T result) {
public void onError(@NonNull final Throwable e) {
Log.e(getTag(), "Error fetching more playlist, marking playlist as complete.", e);
isComplete = true;
append(); // Notify change
notifyChange();
}
};
}
Expand Down Expand Up @@ -117,7 +117,7 @@ public void onSuccess(
public void onError(@NonNull final Throwable e) {
Log.e(getTag(), "Error fetching more playlist, marking playlist as complete.", e);
isComplete = true;
append(); // Notify change
notifyChange();
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,10 @@ public synchronized void offsetIndex(final int offset) {
}

/**
* Appends the given {@link PlayQueueItem}s to the current play queue.
*
* @see #append(List items)
* @param items {@link PlayQueueItem}s to append
* Notifies that a change has occurred.
*/
public synchronized void append(@NonNull final PlayQueueItem... items) {
Copy link
Member

Choose a reason for hiding this comment

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

When this method was called with no arguments it meant that most code in append below did nothing except for broadcast(new AppendEvent(0));. I would rather create a new method called notifyChange() { broadcast(new AppendEvent(0)); } and call it in place of append(Collections.emptyList()); // Notify change

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand, I'll make the change tomorrow.

append(List.of(items));
public synchronized void notifyChange() {
broadcast(new AppendEvent(0));
}

/**
Expand Down