Skip to content

Commit

Permalink
fixed: ZDF weitere fehlende Filme nach hotfix #208
Browse files Browse the repository at this point in the history
closed #211
  • Loading branch information
alex1702 committed Aug 3, 2017
2 parents 834d262 + 0a487be commit 5894c24
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apply from: "${project.rootDir}/gradle/eclipse.gradle"
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'de.mediathekview'
version = '3.1.14'
version = '3.1.15'

def jarName = 'MServer.jar'
def mainClass = 'mServer.Main'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package mServer.crawler.sender.newsearch;

public class NoDownloadInformationException extends Exception
{
public NoDownloadInformationException()
{
super("A film without any download information was found.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,20 @@ public ZDFEntryDTO deserialize(final JsonElement aJsonElement, final Type aTypeO
return dto;
}

private ZDFEntryDTO buildZDFEntryDTO(JsonObject aTargetObject, final JsonObject aMainVideoContentObject)
private ZDFEntryDTO buildZDFEntryDTO(JsonObject aTargetObject, final JsonObject aMainVideoContentObject) throws NoDownloadInformationException
{
JsonObject elementTargetObject = aMainVideoContentObject.getAsJsonObject(JSON_OBJ_ELEMENT_TARGET);
final JsonElement entryGeneralInformationUrlElement = aTargetObject.get(JSON_ELEMENT_GENERAL_INFORMATION_URL);
final JsonElement entryDownloadInformationUrlElement = elementTargetObject.get(JSON_ELEMENT_DOWNLOAD_INFORMATION_URL);
if(elementTargetObject.has(JSON_ELEMENT_DOWNLOAD_INFORMATION_URL))
{
final JsonElement entryDownloadInformationUrlElement = elementTargetObject.get(JSON_ELEMENT_DOWNLOAD_INFORMATION_URL);

String downloadUrl = entryDownloadInformationUrlElement.getAsString()
.replace(PLACEHOLDER_PLAYER_ID, PLAYER_ID);
String downloadUrl = entryDownloadInformationUrlElement.getAsString()
.replace(PLACEHOLDER_PLAYER_ID, PLAYER_ID);

return new ZDFEntryDTO(entryGeneralInformationUrlElement.getAsString(), downloadUrl);
return new ZDFEntryDTO(entryGeneralInformationUrlElement.getAsString(), downloadUrl);
}else {
throw new NoDownloadInformationException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ForkJoinTask;
import java.util.concurrent.RecursiveTask;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -40,7 +41,7 @@ protected Collection<VideoDTO> compute()
if(!Config.getStop()) {
try
{
Collection<ZDFSearchPageTask> subTasks = new ArrayList<>();
Collection<ZDFSearchPageTask> subTasks = ConcurrentHashMap.newKeySet();
JsonObject baseObject;

do {
Expand Down

0 comments on commit 5894c24

Please sign in to comment.