-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #31
Dev #31
Changes from all commits
438762b
f9a37fc
05ade02
7dcef56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,7 +43,7 @@ | |
| public MediaPage getMovie(@Argument(name = "id") Integer id, @Argument(name = "name") String name, DataFetchingEnvironment dataFetchingEnvironment) { | ||
| name = name == null ? null : name.trim(); | ||
|
|
||
| if (name == null & id == null || name == "" & id == null) { | ||
| if (name == null && id == null || name == "" && id == null) { | ||
|
Check warning on line 46 in src/main/java/com/espacogeek/geek/controllers/MediaController.java
|
||
| return new MediaPage(); | ||
| } | ||
|
|
||
|
|
@@ -62,7 +62,7 @@ | |
| public MediaPage getSerie(@Argument(name = "id") Integer id, @Argument(name = "name") String name, DataFetchingEnvironment dataFetchingEnvironment) { | ||
| name = name == null ? null : name.trim(); | ||
|
|
||
| if (name == null & id == null || name == "" & id == null) { | ||
| if (name == null && id == null || name == "" && id == null) { | ||
|
Check warning on line 65 in src/main/java/com/espacogeek/geek/controllers/MediaController.java
|
||
| return new MediaPage(); | ||
|
Comment on lines
+65
to
66
|
||
| } | ||
|
|
||
|
|
@@ -81,7 +81,7 @@ | |
| public MediaPage getGame(@Argument(name = "id") Integer id, @Argument(name = "name") String name, DataFetchingEnvironment dataFetchingEnvironment) { | ||
| name = name == null ? null : name.trim(); | ||
|
|
||
| if (name == null & id == null || name == "" & id == null) { | ||
| if (name == null && id == null || name == "" && id == null) { | ||
|
Check warning on line 84 in src/main/java/com/espacogeek/geek/controllers/MediaController.java
|
||
| return new MediaPage(); | ||
|
Comment on lines
+84
to
85
|
||
| } | ||
|
|
||
|
|
@@ -101,7 +101,7 @@ | |
| MediaPage response = new MediaPage(); | ||
| name = name == null ? null : name.trim(); | ||
|
|
||
| if (name == null & id == null || name == "" & id == null) { | ||
| if (name == null && id == null || name == "" && id == null) { | ||
|
Check warning on line 104 in src/main/java/com/espacogeek/geek/controllers/MediaController.java
|
||
| return response; | ||
|
Comment on lines
+104
to
105
|
||
| } | ||
|
|
||
|
|
@@ -119,7 +119,7 @@ | |
| public MediaPage getAnime(@Argument(name = "id") Integer id, @Argument(name = "name") String name, DataFetchingEnvironment dataFetchingEnvironment) { | ||
| name = name == null ? null : name.trim(); | ||
|
|
||
| if (name == null & id == null || name == "" & id == null) { | ||
| if (name == null && id == null || name == "" && id == null) { | ||
|
Check warning on line 122 in src/main/java/com/espacogeek/geek/controllers/MediaController.java
|
||
| return new MediaPage(); | ||
|
Comment on lines
+122
to
123
|
||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,11 +1,14 @@ | ||||||||
| package com.espacogeek.geek.utils; | ||||||||
|
|
||||||||
| import java.io.ByteArrayInputStream; | ||||||||
| import java.io.IOException; | ||||||||
| import java.io.InputStream; | ||||||||
| import java.io.BufferedReader; | ||||||||
| import java.io.InputStreamReader; | ||||||||
| import java.text.MessageFormat; | ||||||||
| import java.time.LocalDateTime; | ||||||||
| import java.util.zip.GZIPInputStream; | ||||||||
|
|
||||||||
| import lombok.Getter; | ||||||||
| import org.json.simple.JSONArray; | ||||||||
| import org.json.simple.JSONObject; | ||||||||
|
||||||||
| import org.json.simple.JSONObject; |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getDataJumpTMDBStream returns a stream backed by an OkHttp Response, but the Response is never closed on the success path. This will leak connections/sockets unless the response is reliably closed when the returned stream is closed; consider wrapping the returned InputStream so close() also closes the OkHttp Response (and replace the assert response.body() != null with an explicit null check that throws a RequestException).
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new InputStreamReader(is) uses the platform default charset; JSON from TMDB exports is UTF-8. Specify StandardCharsets.UTF_8 to avoid parsing issues on non-UTF-8 default platforms.
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getDataJumpTMDBArray is annotated with @Retryable(...RequestException.class) but the outer catch (Exception e) swallows failures and returns a partial/empty array, which prevents retries and hides errors from callers. Re-throw a RequestException (or let it propagate) after logging so retry semantics work as intended.
| log.error("Error reading TMDB array: {}", e.getMessage()); | |
| log.error("Error reading TMDB array", e); | |
| throw new com.espacogeek.geek.exception.RequestException(); |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -34,13 +34,13 @@ | |||||
| * update was more than one day ago | ||||||
| * or if the update date is null), <code>false</code> otherwise | ||||||
| */ | ||||||
| private static Boolean updateMediaWhenLastTimeUpdateMoreThanOneDay(MediaModel media) { | ||||||
| public static Boolean updateMediaWhenLastTimeUpdateMoreThanOneDay(MediaModel media) { | ||||||
|
||||||
| public static Boolean updateMediaWhenLastTimeUpdateMoreThanOneDay(MediaModel media) { | |
| public static boolean updateMediaWhenLastTimeUpdateMoreThanOneDay(MediaModel media) { |
Check warning on line 43 in src/main/java/com/espacogeek/geek/utils/MediaUtils.java
GitHub Actions / Qodana for JVM
'long' literal ending with 'l' instead of 'L'
'long' literal `1l` ends with lowercase 'l'
Check warning on line 64 in src/main/java/com/espacogeek/geek/utils/MediaUtils.java
GitHub Actions / Qodana for JVM
Mismatched query and update of collection
Contents of collection `updatedMedias` are updated, but never queried
Check warning on line 84 in src/main/java/com/espacogeek/geek/utils/MediaUtils.java
GitHub Actions / Qodana for JVM
Mismatched query and update of collection
Contents of collection `updatedMedias` are updated, but never queried
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check uses
name == "", which compares references rather than string content; empty (or whitespace-only) names may not be detected and will fall through to the service call unexpectedly. After trimming, prefername.isEmpty()/name.isBlank()(and simplify to something likeif (id == null && (name == null || name.isBlank()))).