From bbeffaedfd2e899ce74a129a75c7985bd291df7d Mon Sep 17 00:00:00 2001 From: "W.Xaver" Date: Mon, 19 Apr 2021 13:15:59 +0200 Subject: [PATCH] urlResolved --- .../p2radio/controller/data/station/StationList.java | 8 +++----- .../controller/data/station/StationListFactory.java | 2 +- .../p2tools/p2radio/gui/StationGuiTableContextMenu.java | 1 - .../tools/stationListFilter/StationFilterFactory.java | 1 + src/main/resources/version.properties | 6 +++--- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/p2tools/p2radio/controller/data/station/StationList.java b/src/main/java/de/p2tools/p2radio/controller/data/station/StationList.java index aecb7a0..7056f99 100644 --- a/src/main/java/de/p2tools/p2radio/controller/data/station/StationList.java +++ b/src/main/java/de/p2tools/p2radio/controller/data/station/StationList.java @@ -177,13 +177,11 @@ public synchronized int markStations() { PDuration.counterStart("Sender markieren"); try { countDouble = 0; - this.stream().forEach((Station f) -> { - - if (!urlHashSet.add(f.getUrl())) { + this.stream().forEach(station -> { + if (!urlHashSet.add(station.getUrl())) { ++countDouble; - f.setDoubleUrl(true); + station.setDoubleUrl(true); } - }); } catch (Exception ex) { diff --git a/src/main/java/de/p2tools/p2radio/controller/data/station/StationListFactory.java b/src/main/java/de/p2tools/p2radio/controller/data/station/StationListFactory.java index 98aedf6..a9417fa 100644 --- a/src/main/java/de/p2tools/p2radio/controller/data/station/StationListFactory.java +++ b/src/main/java/de/p2tools/p2radio/controller/data/station/StationListFactory.java @@ -103,8 +103,8 @@ public static void findAndMarkFavouriteStations(ProgData progData) { PDuration.counterStart("findAndMarkFavouriteStations"); final HashSet hashSet = new HashSet<>(); hashSet.addAll(progData.favouriteList.stream().map(Favourite::getUrl).collect(Collectors.toList())); + progData.stationList.parallelStream().forEach(station -> station.setFavouriteUrl(false)); progData.stationList.stream() - .peek(station -> station.setFavouriteUrl(false)) .filter(station -> hashSet.contains(station.getUrl())) .forEach(station -> station.setFavouriteUrl(true)); hashSet.clear(); diff --git a/src/main/java/de/p2tools/p2radio/gui/StationGuiTableContextMenu.java b/src/main/java/de/p2tools/p2radio/gui/StationGuiTableContextMenu.java index 3c90504..a295b8b 100644 --- a/src/main/java/de/p2tools/p2radio/gui/StationGuiTableContextMenu.java +++ b/src/main/java/de/p2tools/p2radio/gui/StationGuiTableContextMenu.java @@ -146,7 +146,6 @@ private Menu copyUrl(Station station) { return subMenuURL; } - final String uNormal = station.getUrl(); MenuItem item; item = new MenuItem("Sender-URL kopieren"); item.setOnAction(a -> PSystemUtils.copyToClipboard(station.getUrl())); diff --git a/src/main/java/de/p2tools/p2radio/tools/stationListFilter/StationFilterFactory.java b/src/main/java/de/p2tools/p2radio/tools/stationListFilter/StationFilterFactory.java index 42b7034..fe77741 100644 --- a/src/main/java/de/p2tools/p2radio/tools/stationListFilter/StationFilterFactory.java +++ b/src/main/java/de/p2tools/p2radio/tools/stationListFilter/StationFilterFactory.java @@ -78,6 +78,7 @@ public static boolean checkCountry(Filter sender, Station station) { } public static boolean checkUrl(Filter url, Station station) { + //todo evtl. noch urlResolved einfügen??? if (!check(url, station.getWebsite()) && !check(url, station.getUrl())) { return false; diff --git a/src/main/resources/version.properties b/src/main/resources/version.properties index 36b0498..21c4754 100644 --- a/src/main/resources/version.properties +++ b/src/main/resources/version.properties @@ -1,4 +1,4 @@ -#Sun Apr 18 19:58:05 CEST 2021 -DATE=18.04.2021 -BUILD=40 +#Mon Apr 19 12:54:33 CEST 2021 +DATE=19.04.2021 +BUILD=42 VERSION=0