diff --git a/back/src/org/kar/karideo/api/VideoResource.java b/back/src/org/kar/karideo/api/VideoResource.java index 8c6e8ad..058f889 100644 --- a/back/src/org/kar/karideo/api/VideoResource.java +++ b/back/src/org/kar/karideo/api/VideoResource.java @@ -150,7 +150,9 @@ public class VideoResource { DataResource.removeTemporaryFile(tmpUID); 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("add media"); @@ -171,7 +173,7 @@ public class VideoResource { media.seasonId = seasonNode.id; } media.episode = null; - if (episode != null || ! episode.contentEquals("")) { + if (episode != null && ! episode.contentEquals("")) { media.episode = Integer.parseInt(episode); } Media out = SqlWrapper.insert(media);