forked from TeamNewPipe/NewPipe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request TeamNewPipe#3863 from TeamNewPipe/release_0.19.6
Release 0.19.6
- Loading branch information
Showing
106 changed files
with
3,475 additions
and
1,039 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/java/org/schabi/newpipe/database/playlist/PlaylistLocalItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
package org.schabi.newpipe.database.playlist; | ||
|
||
import org.schabi.newpipe.database.LocalItem; | ||
import org.schabi.newpipe.database.playlist.model.PlaylistRemoteEntity; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public interface PlaylistLocalItem extends LocalItem { | ||
String getOrderingName(); | ||
|
||
static List<PlaylistLocalItem> merge( | ||
final List<PlaylistMetadataEntry> localPlaylists, | ||
final List<PlaylistRemoteEntity> remotePlaylists) { | ||
final List<PlaylistLocalItem> items = new ArrayList<>( | ||
localPlaylists.size() + remotePlaylists.size()); | ||
items.addAll(localPlaylists); | ||
items.addAll(remotePlaylists); | ||
|
||
Collections.sort(items, (left, right) -> { | ||
final String on1 = left.getOrderingName(); | ||
final String on2 = right.getOrderingName(); | ||
if (on1 == null) { | ||
return on2 == null ? 0 : 1; | ||
} else { | ||
return on2 == null ? -1 : on1.compareToIgnoreCase(on2); | ||
} | ||
}); | ||
|
||
return items; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.