Merge pull request #3345 from mitosagi/error-with-bookmarks

Fix repeated exceptions in Bookmarked Playlists
pull/3462/head
Tobias Groza 2020-04-19 22:00:31 +02:00 zatwierdzone przez GitHub
commit cd53518897
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 13 dodań i 2 usunięć

Wyświetl plik

@ -62,8 +62,19 @@ public final class BookmarkFragment extends BaseLocalListFragment<List<PlaylistL
items.addAll(localPlaylists);
items.addAll(remotePlaylists);
Collections.sort(items, (left, right) ->
left.getOrderingName().compareToIgnoreCase(right.getOrderingName()));
Collections.sort(items, (left, right) -> {
String on1 = left.getOrderingName();
String on2 = right.getOrderingName();
if (on1 == null && on2 == null) {
return 0;
} else if (on1 != null && on2 == null) {
return -1;
} else if (on1 == null && on2 != null) {
return 1;
} else {
return on1.compareToIgnoreCase(on2);
}
});
return items;
}