Skip to content

Commit

Permalink
feature: Copyright aus Titel entfernen
Browse files Browse the repository at this point in the history
  • Loading branch information
alex1702 committed May 24, 2018
2 parents 1d018fe + b673398 commit 1a97d58
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ targetCompatibility = 1.8

group = 'de.mediathekview'
archivesBaseName = "MLib"
version = '3.0.1'
version = '3.0.2'

ext {
propsFile = file('src/main/resources/version.properties').absoluteFile
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/de/mediathekview/mlib/daten/DatenFilm.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

public class DatenFilm implements Comparable<DatenFilm> {

private static final String COPYRIGHT_CHAR_HTML = "&copy;";

public static final String AUFLOESUNG_NORMAL = "normal";
public static final String AUFLOESUNG_HD = "hd";
public static final String AUFLOESUNG_KLEIN = "klein";
Expand Down Expand Up @@ -127,7 +129,7 @@ public DatenFilm(String ssender, String tthema, String filmWebsite, String ttite
// da werden die gefundenen Filme beim Absuchen der Senderwebsites erstellt, und nur die!!
arr[FILM_SENDER] = ssender;
arr[FILM_THEMA] = tthema.isEmpty() ? ssender : tthema.trim();
arr[FILM_TITEL] = ttitel.isEmpty() ? tthema : ttitel.trim();
setTitle(ttitel.isEmpty() ? tthema : ttitel.trim());
arr[FILM_URL] = uurl;
arr[FILM_URL_RTMP] = uurlRtmp;
arr[FILM_WEBSEITE] = filmWebsite;
Expand All @@ -138,6 +140,14 @@ public DatenFilm(String ssender, String tthema, String filmWebsite, String ttite
// Filmlänge
checkFilmDauer(dauerSekunden);
}

private void setTitle(String title) {
if (title.contains(COPYRIGHT_CHAR_HTML)) {
title = title.substring(0, title.indexOf(COPYRIGHT_CHAR_HTML));
title = title.trim();
}
arr[FILM_TITEL] = title;
}

/**
* Determine file size from remote location.
Expand Down

0 comments on commit 1a97d58

Please sign in to comment.