Merge pull request #5492 from ByteHamster/sort-dictionary

Sort queue in dictionary order
This commit is contained in:
ByteHamster 2021-10-30 12:04:46 +02:00 committed by GitHub
commit 639a748bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 8 deletions

View File

@ -9,6 +9,7 @@ import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.model.feed.FeedItem;
@ -77,25 +78,22 @@ public class FeedItemPermutors {
@NonNull @NonNull
private static Date pubDate(@Nullable FeedItem item) { private static Date pubDate(@Nullable FeedItem item) {
return (item != null && item.getPubDate() != null) ? return (item != null && item.getPubDate() != null) ? item.getPubDate() : new Date(0);
item.getPubDate() : new Date(0);
} }
@NonNull @NonNull
private static String itemTitle(@Nullable FeedItem item) { private static String itemTitle(@Nullable FeedItem item) {
return (item != null && item.getTitle() != null) ? return (item != null && item.getTitle() != null) ? item.getTitle().toLowerCase(Locale.getDefault()) : "";
item.getTitle() : "";
} }
private static int duration(@Nullable FeedItem item) { private static int duration(@Nullable FeedItem item) {
return (item != null && item.getMedia() != null) ? return (item != null && item.getMedia() != null) ? item.getMedia().getDuration() : 0;
item.getMedia().getDuration() : 0;
} }
@NonNull @NonNull
private static String feedTitle(@Nullable FeedItem item) { private static String feedTitle(@Nullable FeedItem item) {
return (item != null && item.getFeed() != null && item.getFeed().getTitle() != null) ? return (item != null && item.getFeed() != null && item.getFeed().getTitle() != null)
item.getFeed().getTitle() : ""; ? item.getFeed().getTitle().toLowerCase(Locale.getDefault()) : "";
} }
/** /**