Example #1
0
 public void setJson(JSONObject json) {
   try {
     ID = json.getInt("scheda_id");
     title = json.getString("title");
     relese = json.getString("release_date");
     poster = json.getString("poster");
     back = json.getString("background");
     desc = json.getString("description");
     this.setGeneriIDs(json.getString("genre_ids"));
     vote = json.getDouble("vote");
     type = MainType.getMainTypeByID(json.getInt("type"));
     fallback_desc = json.getInt("fallback");
   } catch (Exception e) {
     Log.stack(Log.BACKEND, e);
   }
 }
Example #2
0
 public JSONObject getJson() {
   JSONObject json = new JSONObject();
   try {
     json.put("scheda_id", ID);
     json.put("title", title);
     json.put("release_date", relese);
     json.put("poster", poster);
     json.put("background", back);
     json.put("description", desc);
     json.put("genre_ids", getGeneriIDs());
     json.put("vote", vote);
     json.put("type", type.ID);
     json.put("fallback", fallback_desc);
   } catch (Exception e) {
     Log.stack(Log.BACKEND, e);
   }
   return json;
 }