Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/dev ardv6 #979

Merged
merged 15 commits into from
May 18, 2024
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package de.mediathekview.mserver.crawler.ard;

import java.util.HashMap;
import java.util.Map;

import de.mediathekview.mlib.daten.Sender;

public class ArdConstants {

public static final String API_URL = "https://api.ardmediathek.de";
public static final String BASE_URL = "https://api.ardmediathek.de/public-gateway";

public static final String ITEM_URL = API_URL + "/page-gateway/pages/ard/item/";
public static final String ITEM_URL = API_URL + "/page-gateway/pages/ard/item/%s?embedded=true&mcV6=true";

public static final String TOPICS_URL = API_URL + "/page-gateway/pages/%s/editorial/experiment-a-z?embedded=false";
public static final String TOPICS_COMPILATION_URL = API_URL + "/page-gateway/widgets/%s/editorials/%s?pageNumber=0&pageSize=%s";
Expand All @@ -31,13 +36,34 @@ public class ArdConstants {
"swr",
"wdr",
"one",
"funk",
"alpha",
"tagesschau24",
"funk",
"phoenix",
"arte"
"phoenix"
};

public static final Map<String, Sender> PARTNER_TO_SENDER = new HashMap<>();

static {
PARTNER_TO_SENDER.put("rbb", Sender.RBB);
PARTNER_TO_SENDER.put("swr", Sender.SWR);
PARTNER_TO_SENDER.put("mdr", Sender.MDR);
PARTNER_TO_SENDER.put("ndr", Sender.NDR);
PARTNER_TO_SENDER.put("wdr", Sender.WDR);
PARTNER_TO_SENDER.put("hr", Sender.HR);
PARTNER_TO_SENDER.put("br", Sender.BR);
PARTNER_TO_SENDER.put("radio_bremen", Sender.RBTV);
PARTNER_TO_SENDER.put("tagesschau24", Sender.ARD);
PARTNER_TO_SENDER.put("das_erste", Sender.ARD);
PARTNER_TO_SENDER.put("one", Sender.ONE); // ONE
PARTNER_TO_SENDER.put("ard-alpha", Sender.ARD_ALPHA); // ARD-alpha
PARTNER_TO_SENDER.put("funk", Sender.FUNK); // Funk.net
PARTNER_TO_SENDER.put("sr", Sender.SR);
PARTNER_TO_SENDER.put("phoenix", Sender.PHOENIX);
PARTNER_TO_SENDER.put("ard", Sender.ARD);
//IGNORED_SENDER "zdf", "kika", "3sat", "arte"
}

public static final String WEBSITE_URL = "https://www.ardmediathek.de/video/%s";

public static final String BASE_URL_SUBTITLES = "https://classic.ardmediathek.de";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,22 @@

public class ArdTopicInfoDto {
private final Set<ArdFilmInfoDto> filmInfos;
private int subPageNumber;
private int maxSubPageNumber;
private int pageNumber;
private int pageSize;
private int totalElements;


public ArdTopicInfoDto(final Set<ArdFilmInfoDto> filmInfos) {
this.filmInfos = filmInfos;
subPageNumber = 0;
maxSubPageNumber = 0;
setPageNumber(0);
setPageSize(0);
setTotalElements(0);
}

public Set<ArdFilmInfoDto> getFilmInfos() {
return filmInfos;
}

public int getSubPageNumber() {
return subPageNumber;
}

public void setSubPageNumber(final int subPageNumber) {
this.subPageNumber = subPageNumber;
}

public int getMaxSubPageNumber() {
return maxSubPageNumber;
}

public void setMaxSubPageNumber(final int maxSubPageNumber) {
this.maxSubPageNumber = maxSubPageNumber;
}

@Override
public boolean equals(final Object o) {
Expand All @@ -42,13 +30,38 @@ public boolean equals(final Object o) {
if (!(o instanceof final ArdTopicInfoDto that)) {
return false;
}
return getSubPageNumber() == that.getSubPageNumber()
&& getMaxSubPageNumber() == that.getMaxSubPageNumber()
return getPageNumber() == that.getPageNumber()
&& getPageSize() == that.getPageSize()
&& getTotalElements() == that.getTotalElements()
&& Objects.equals(filmInfos, that.filmInfos);
}

@Override
public int hashCode() {
return Objects.hash(filmInfos, getSubPageNumber(), getMaxSubPageNumber());
return Objects.hash(filmInfos, getPageNumber(), getPageSize(), getTotalElements());
}

public int getPageNumber() {
return pageNumber;
}

public void setPageNumber(int pageNumber) {
this.pageNumber = pageNumber;
}

public int getPageSize() {
return pageSize;
}

public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}

public int getTotalElements() {
return totalElements;
}

public void setTotalElements(int totalElements) {
this.totalElements = totalElements;
}
}
Loading
Loading