Anonymous avatar Anonymous committed ab6eabf

Moved shortUrl into media object since it needs to be transported across activities.

Comments (0)

Files changed (4)

service/src/com/photobucket/api/service/MediaGetStrategy.java

     private int likeCount;
     private List<String> likers;
     private boolean userLikes;
-    private String shortUrl; 
     
     public MediaGetStrategy(String mediaUrl) {
         this(null, mediaUrl);
         }
         
         if (includeLinks) {
-            shortUrl = mediaObject.getString("shorturl");
+            media.setShortUrl(mediaObject.getString("shorturl"));
         }
     }
     
         return media;
     }
     
-    public String getShortUrl() {
-        return shortUrl;
-    }
-    
     public List<Tag> getTags() {
         return tags;
     }

service/src/com/photobucket/api/service/MediaLikeDeleteStrategy.java

 package com.photobucket.api.service;
 
 import org.json.JSONException;
-import org.json.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
     @Override
     protected void parseContent(Object contentObject) throws APIException, JSONException {
-        JSONObject content = (JSONObject)contentObject;
         viewerLikes = false;
     }
     

service/src/com/photobucket/api/service/model/Media.java

     private boolean sponsored;
     private int likesCount;
     private int commentCount;
+    private String shorUrl;
     
     // The following are derived values.
     private String silo;
         URL url = new URL ( getDirectFileAccessUrl () );
         return url.getPath ();
     }
+
+    public String getShortUrl() {
+        return shorUrl;
+    }
+    
+    public void setShortUrl(String shortUrl) {
+        this.shorUrl = shortUrl;
+    }
     
     /**
      * Parses the browse url for the silo #. The API does not currently supply this. See my note above where the static

service/test/com/photobucket/api/service/MediaGetStrategyTest.java

         Assert.assertEquals(0, strategy.getTags().size());
         Assert.assertEquals(1, strategy.getLikeCount());
         Assert.assertTrue(strategy.getUserLikes());
-        Assert.assertNotNull(strategy.getShortUrl());
+        Assert.assertNotNull(strategy.getMedia().getShortUrl());
     }
 
     
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.