Skip to content

Commit 0129f27

Browse files
committed
SD image requests - cleanup logging 2
1 parent b69779c commit 0129f27

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

java/sage/MetaImage.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,7 +3216,7 @@ private boolean loadCacheFile()
32163216
HttpURLConnection.setFollowRedirects(true);
32173217
URL myURL = (URL) src;
32183218
URLConnection myURLConn;
3219-
boolean isSDURL = false;
3219+
boolean isSDURL = false; //identifies an Schedules Direct image that needs special handling
32203220
try
32213221
{
32223222
while (true)
@@ -3245,8 +3245,7 @@ private boolean loadCacheFile()
32453245
if (Sage.DBG) System.out.println("MetaImage.loadCacheFile: No token so skipping src = '" + src + "'");
32463246
break;
32473247
}else{
3248-
//TODO: remove the following after testing
3249-
if (Sage.DBG) System.out.println("MetaImage.loadCacheFile: Adding token to Request. token = '" + sdToken + "'");
3248+
if (Sage.DBG && SDSession.debugEnabled()) System.out.println("MetaImage.loadCacheFile: Adding token to Request. token = '" + sdToken + "'");
32503249
myURLConn.addRequestProperty("token", sdToken);
32513250
myURLConn.setRequestProperty("User-Agent", SDSession.USER_AGENT);
32523251
//secret SD debug mode that will send requests to their debug server. Only enable when working with SD Support
@@ -3260,13 +3259,10 @@ private boolean loadCacheFile()
32603259
is = myURLConn.getInputStream();
32613260
if (myURLConn instanceof HttpURLConnection)
32623261
{
3263-
//TODO: SD testing of response code
32643262
HttpURLConnection httpConn = (HttpURLConnection) myURLConn;
32653263
if (isSDURL) {
3266-
if (Sage.DBG) System.out.println("MetaImage.loadCacheFile: HttpURLConnection response found for SD image - type:" + httpConn.getContentType() + " response code:" + httpConn.getResponseCode());
32673264
if ("application/json".equals(httpConn.getContentType())){
32683265
//SD returned an error which is within the returned json
3269-
//TODO: remove after testing
32703266
int imageErrorCode = SDUtils.handleSDJsonErrorFromHttpResponse(httpConn);
32713267
if(imageErrorCode==1004){ //no or invalid token
32723268
is.close();

java/sage/epg/sd/SDUtils.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ public static int handleSDJsonErrorFromHttpResponse(HttpURLConnection httpConn)
9090
InputStream inputStream = new BufferedInputStream(httpConn.getInputStream());
9191
InputStreamReader reader = new InputStreamReader(inputStream, SDSession.IN_CHARSET);
9292
JsonElement errorElement = GSON.fromJson(reader, JsonElement.class);
93-
if (Sage.DBG) System.out.println("SDUtils.handleSDJsonErrorFromHttpResponse: Start of handler");
94-
9593
if (errorElement instanceof JsonObject)
9694
{
9795
JsonElement codeElement = ((JsonObject) errorElement).get("code");

0 commit comments

Comments
 (0)