[DEBUG] correct season checking

This commit is contained in:
Edouard DUPIN 2023-04-27 11:32:36 +02:00
parent ff0bb5743f
commit b5ce560c88

View File

@ -150,7 +150,9 @@ public class VideoResource {
DataResource.removeTemporaryFile(tmpUID); DataResource.removeTemporaryFile(tmpUID);
throw new InputException("season", "Season is set but no seraies is set !!"); throw new InputException("season", "Season is set but no seraies is set !!");
} }
seasonNode = SeasonResource.getOrCreate(season, seriesNode.id); if (season != null) {
seasonNode = SeasonResource.getOrCreate(season, seriesNode.id);
}
System.out.println(" ==> " + seasonNode); System.out.println(" ==> " + seasonNode);
System.out.println("add media"); System.out.println("add media");
@ -171,7 +173,7 @@ public class VideoResource {
media.seasonId = seasonNode.id; media.seasonId = seasonNode.id;
} }
media.episode = null; media.episode = null;
if (episode != null || ! episode.contentEquals("")) { if (episode != null && ! episode.contentEquals("")) {
media.episode = Integer.parseInt(episode); media.episode = Integer.parseInt(episode);
} }
Media out = SqlWrapper.insert(media); Media out = SqlWrapper.insert(media);