// Path: src/com/oakesville/mythling/util/Reporter.java
// public class Reporter {
//     private static final String TAG = Reporter.class.getSimpleName();
//     private static final String ERROR_REPORTING_URL = "http://54.187.163.194/mythling/report";
// 
//     private Throwable throwable;
//     private final String message;
// 
//     public Reporter(Throwable t) {
//         this.throwable = t;
//         this.message = t.getMessage();
//     }
// 
//     public Reporter(String message) {
//         this.message = message;
//     }
// 
//     /**
//      * Report the error in a background thread.
//      */
//     public void send() {
//         new Thread(new Runnable() {
//             public void run() {
//                 try {
//                     JSONObject json = buildJson();
//                     HttpHelper helper = new HttpHelper(new URL(ERROR_REPORTING_URL));
//                     String response = new String(helper.post(json.toString(2).getBytes()));
//                     JSONObject responseJson = new JSONObject(response);
//                     JSONObject reportResponse = responseJson.getJSONObject("reportResponse");
//                     String status = reportResponse.getString("status");
//                     if (!"success".equals(status))
//                         throw new IOException("Error response from reporting site: " + reportResponse.getString("message"));
//                 } catch (Exception ex) {
//                     Log.e(TAG, ex.getMessage(), ex);
//                 }
//             }
//         }).start();
//     }
// 
//     private JSONObject buildJson() throws JSONException {
//         JSONObject json = new JSONObject();
//         JSONObject report = new JSONObject();
//         json.put("report", report);
//         report.put("source", "Mythling v" + AppSettings.staticGetMythlingVersion() +
//                 " (sdk " + AppSettings.getAndroidVersion() + ")");
//         report.put("message", message == null ? "No message" : message);
//         if (throwable != null) {
//             ByteArrayOutputStream out = new ByteArrayOutputStream();
//             throwable.printStackTrace(new PrintStream(out));
//             report.put("stackTrace", new String(out.toByteArray()));
//         }
//         return json;
//     }
// }


import java.text.SimpleDateFormat;
import com.oakesville.mythling.R;
import com.oakesville.mythling.util.Reporter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import io.oakesville.media.MediaSettings.MediaType;
import io.oakesville.media.MediaSettings.MediaTypeDeterminer;
import io.oakesville.media.MediaSettings.SortType;

        if (resName.endsWith(": "))
            resName = resName.substring(0, resName.length() - 2) + "_";
        resName = resName.replace(' ', '_');
        return getAppContext().getResources().getString(getStringResId(resName));
    }

    public String getItemTypeLabel(MediaType mediaType) {
        if (mediaType == MediaType.music)
            return getStringRes(R.string.song);
        else if (mediaType == MediaType.videos)
            return getStringRes(R.string.video);
        else if (mediaType == MediaType.recordings)
            return getStringRes(R.string.recording);
        else if (mediaType == MediaType.liveTv)
            return getStringRes(R.string.live_tv);
        else if (mediaType == MediaType.movies)
            return getStringRes(R.string.movie);
        else if (mediaType == MediaType.tvSeries)
            return getStringRes(R.string.tv_episode);
        else if (mediaType == MediaType.images)
            return getStringRes(R.string.image);
        else
            return "";
    }

    @Override
    public String getSortLabel(SortType sortType) {
        if (sortType == SortType.byDate)
            return getStringRes(R.string.by_date);
        else if (sortType == SortType.byRating)

// Path: src/com/oakesville/mythling/util/Reporter.java
// public class Reporter {
//     private static final String TAG = Reporter.class.getSimpleName();
//     private static final String ERROR_REPORTING_URL = "http://54.187.163.194/mythling/report";
// 
//     private Throwable throwable;
//     private final String message;
// 
//     public Reporter(Throwable t) {
//         this.throwable = t;
//         this.message = t.getMessage();
//     }
// 
//     public Reporter(String message) {
//         this.message = message;
//     }
// 
//     /**
//      * Report the error in a background thread.
//      */
//     public void send() {
//         new Thread(new Runnable() {
//             public void run() {
//                 try {
//                     JSONObject json = buildJson();
//                     HttpHelper helper = new HttpHelper(new URL(ERROR_REPORTING_URL));
//                     String response = new String(helper.post(json.toString(2).getBytes()));
//                     JSONObject responseJson = new JSONObject(response);
//                     JSONObject reportResponse = responseJson.getJSONObject("reportResponse");
//                     String status = reportResponse.getString("status");
//                     if (!"success".equals(status))
//                         throw new IOException("Error response from reporting site: " + reportResponse.getString("message"));
//                 } catch (Exception ex) {
//                     Log.e(TAG, ex.getMessage(), ex);
//                 }
//             }
//         }).start();
//     }
// 
//     private JSONObject buildJson() throws JSONException {
//         JSONObject json = new JSONObject();
//         JSONObject report = new JSONObject();
//         json.put("report", report);
//         report.put("source", "Mythling v" + AppSettings.staticGetMythlingVersion() +
//                 " (sdk " + AppSettings.getAndroidVersion() + ")");
//         report.put("message", message == null ? "No message" : message);
//         if (throwable != null) {
//             ByteArrayOutputStream out = new ByteArrayOutputStream();
//             throwable.printStackTrace(new PrintStream(out));
//             report.put("stackTrace", new String(out.toByteArray()));
//         }
//         return json;
//     }
// }


// Path: src/com/oakesville/mythling/app/Localizer.java
import java.text.SimpleDateFormat;
import com.oakesville.mythling.R;
import com.oakesville.mythling.util.Reporter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import io.oakesville.media.MediaSettings.MediaType;
import io.oakesville.media.MediaSettings.MediaTypeDeterminer;
import io.oakesville.media.MediaSettings.SortType;

        if (resName.endsWith(": "))
            resName = resName.substring(0, resName.length() - 2) + "_";
        resName = resName.replace(' ', '_');
        return getAppContext().getResources().getString(getStringResId(resName));
    }

    public String getItemTypeLabel(MediaType mediaType) {
        if (mediaType == MediaType.music)
            return getStringRes(R.string.song);
        else if (mediaType == MediaType.videos)
            return getStringRes(R.string.video);
        else if (mediaType == MediaType.recordings)
            return getStringRes(R.string.recording);
        else if (mediaType == MediaType.liveTv)
            return getStringRes(R.string.live_tv);
        else if (mediaType == MediaType.movies)
            return getStringRes(R.string.movie);
        else if (mediaType == MediaType.tvSeries)
            return getStringRes(R.string.tv_episode);
        else if (mediaType == MediaType.images)
            return getStringRes(R.string.image);
        else
            return "";
    }

    @Override
    public String getSortLabel(SortType sortType) {
        if (sortType == SortType.byDate)
            return getStringRes(R.string.by_date);
        else if (sortType == SortType.byRating)

            return getStringRes(R.string.by_rating);
