From b5ce560c888430be693f6e9aca348a09d72762ce Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 27 Apr 2023 11:32:36 +0200 Subject: [PATCH] [DEBUG] correct season checking --- back/src/org/kar/karideo/api/VideoResource.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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);