mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-06 12:23:55 +00:00
HomeServiceUtil.isPartOfEvent can now be called for every Leaderboard
and not only for Regattas
This commit is contained in:
1 parent
7d710df854
commit
668d71ca12
2 files changed
+3
-5
No files matched your search
+2
-4
@@ -18,7 +18,6 @@ import com.sap.sailing.domain.base.EventBase;
|
||||
import com.sap.sailing.domain.base.Fleet;
|
||||
import com.sap.sailing.domain.base.LeaderboardGroupBase;
|
||||
import com.sap.sailing.domain.base.RaceColumn;
|
||||
import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.domain.leaderboard.Leaderboard;
|
||||
import com.sap.sailing.domain.leaderboard.LeaderboardGroup;
|
||||
import com.sap.sailing.domain.leaderboard.RegattaLeaderboard;
|
||||
@@ -231,7 +230,7 @@ public final class HomeServiceUtil {
|
||||
return !Util.isEmpty(event.getVideos());
|
||||
}
|
||||
|
||||
public static boolean isPartOfEvent(Event event, Regatta regattaEntity) {
|
||||
public static boolean isPartOfEvent(Event event, Leaderboard regattaEntity) {
|
||||
for (CourseArea courseArea : event.getVenue().getCourseAreas()) {
|
||||
if(courseArea.equals(regattaEntity.getDefaultCourseArea())) {
|
||||
return true;
|
||||
@@ -400,8 +399,7 @@ public final class HomeServiceUtil {
|
||||
Event event = (Event) eventBase;
|
||||
for (Leaderboard leaderboard : event.getLeaderboardGroups().iterator().next().getLeaderboards()) {
|
||||
if(leaderboard instanceof RegattaLeaderboard) {
|
||||
Regatta regattaEntity = service.getRegattaByName(leaderboard.getName());
|
||||
if(!HomeServiceUtil.isPartOfEvent(event, regattaEntity)) {
|
||||
if(!HomeServiceUtil.isPartOfEvent(event, leaderboard)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public class GetEventViewAction implements Action<EventViewDTO> {
|
||||
for (Leaderboard leaderboard : leaderboardGroup.getLeaderboards()) {
|
||||
if(leaderboard instanceof RegattaLeaderboard) {
|
||||
Regatta regatta = context.getRacingEventService().getRegattaByName(leaderboard.getName());
|
||||
if(isFakeSeries && !HomeServiceUtil.isPartOfEvent(event, regatta)) {
|
||||
if(isFakeSeries && !HomeServiceUtil.isPartOfEvent(event, leaderboard)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user