Skip to content

Commit

Permalink
fix zdf duplicates
Browse files Browse the repository at this point in the history
SRF in 1080p und 720p anbieten wie beim ARD und ZDF
  • Loading branch information
alex1702 committed Mar 10, 2025
2 parents 3090183 + 9cb92a6 commit 87f7beb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
group = 'de.mediathekview'
archivesBaseName = "MServer"
version = '3.1.247'
version = '3.1.248'

def jarName = 'MServer.jar'
def mainClass = 'mServer.Main'

dependencies {
implementation 'de.mediathekview:MLib:3.0.13'
implementation 'de.mediathekview:MLib:3.0.14'
implementation 'commons-net:commons-net:3.9.0'
implementation 'org.apache.commons:commons-compress:1.22'
implementation 'org.apache.commons:commons-text:1.10.0'
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/mServer/crawler/FilmeSuchen.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,17 @@ public synchronized void meldenFertig(String sender) {
mrClear();
if (CrawlerConfig.updateFilmliste) {
// alte Filme eintragen wenn angefordert oder nur ein update gesucht wurde
//////toDo
zeile = "" + '\n';
zeile += "-------------------------------------------------------------------------------------" + '\n';
zeile += "Update Filmliste:" + '\n';
zeile += " -> Einträge bisher: " + listeFilmeNeu.size() + '\n';
zeile += " -> Einträge alte: " + listeFilmeAlt.size() + '\n';

listeFilmeNeu.updateListe(listeFilmeAlt, true /* über den Index vergleichen */, false /*ersetzen*/);

zeile += " -> Einträge danach: " + listeFilmeNeu.size() + '\n';
zeile += "-------------------------------------------------------------------------------------" + '\n';
Log.sysLog(zeile);
}
listeFilmeNeu.sort();
// FilmlisteMetaDaten
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mServer/crawler/sender/base/M3U8Dto.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public Optional<Qualities> getResolution() {
case "480x320":
case "480x360":
case "512x288":
return Optional.of(Qualities.SMALL);
case "636x360":
case "640x360":
case "640x480":
Expand All @@ -77,15 +76,16 @@ public Optional<Qualities> getResolution() {
case "720x544":
case "768x576":
case "852x480":
return Optional.of(Qualities.SMALL);
case "960x540":
case "960x544":
case "1024x576":
case "1064x576":
case "1152x576":
return Optional.of(Qualities.NORMAL);
case "1280x720":
case "1330x720":
case "1440x720":
return Optional.of(Qualities.NORMAL);
case "1920x1080":
case "2560x1440":
case "3840x2160":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ private static Optional<Qualities> getResolution(M3U8Dto aDto) {
if (widthMeta.isPresent()) {
int width = Integer.parseInt(widthMeta.get());

if (width <= 700000) {
return Optional.of(Qualities.SMALL);
} else if (width > 3000000) {
if (width > 6000000) {
return Optional.of(Qualities.HD);
} else {
} else if (width > 2000000) {
return Optional.of(Qualities.NORMAL);
} else {
return Optional.of(Qualities.SMALL);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ public void setUp() {
list.add(createTestFilm(Const.BR, FILM_TOPIC1, FILM_TITLE1, "film1.mp4"));
list.add(createTestFilm(Const.BR, FILM_TOPIC2, FILM_TITLE1, "film2.mp4"));
}
@Test
public void testNotAddSameSenderTopicTitleButDifferentUrl() {
listToAdd.add(createTestFilm(Const.BR, FILM_TOPIC1, FILM_TITLE1, FILM_NAME_ONLINE));
AddToFilmlist target = new AddToFilmlist(list, listToAdd);
target.addOldList();

assertEquals(list.size(), 2);
}

@Test
public void testAddOldListDifferentSenderAndUrlAdded() {
Expand Down

0 comments on commit 87f7beb

Please sign in to comment.