// Path: app/src/main/java/org/freemp/droid/Constants.java
// public final class Constants {
//     public static final int TYPE_MS = 0;
//     public static final int TYPE_FS = 1;
//     public static final int TYPE_GM = 2;
//     public static final int NUM_ITEMS = 3;
//     public static final String KEY_TITLE = "title";
//     public static final boolean DEBUG = true;
// }


import android.app.Activity;
import android.os.AsyncTask;
import android.os.Environment;
import android.preference.PreferenceManager;
import org.freemp.droid.Constants;
import java.lang.ref.WeakReference;
package org.freemp.droid.playlist;





/**
 * Created by recoil on 01.06.14.
 */
public class TaskGetPlaylist extends AsyncTask {

    private final WeakReference<Activity> mActivity;
    private final WeakReference<OnTaskGetPlaylist> mOnTaskGetPlaylist;
    private int type;
    private boolean refresh;

    public TaskGetPlaylist(Activity activity, int type, boolean refresh, OnTaskGetPlaylist onTaskGetPlaylist) {

        mActivity = new WeakReference<Activity>(activity);
        mOnTaskGetPlaylist = new WeakReference<OnTaskGetPlaylist>(onTaskGetPlaylist);
        String scanDir = PreferenceManager.getDefaultSharedPreferences(mActivity.get()).getString("scanDir", Environment.getExternalStorageDirectory().getAbsolutePath().toString());
        //Log.w("ScanDir is:",scanDir);
        if (scanDir == null || scanDir.equals("/") || scanDir.equals("/sdcard") || scanDir.equals("/storage/emulated/0")) {
            type = 0;
        }
        this.type = type;
        this.refresh = refresh;
    }

    @Override
    protected Object doInBackground(Object... params) {
        Activity activity = mActivity.get();
        if (null == activity) {
            return null;
        }
        switch (this.type) {
// Path: app/src/main/java/org/freemp/droid/Constants.java
// public final class Constants {
//     public static final int TYPE_MS = 0;
//     public static final int TYPE_FS = 1;
//     public static final int TYPE_GM = 2;
//     public static final int NUM_ITEMS = 3;
//     public static final String KEY_TITLE = "title";
//     public static final boolean DEBUG = true;
// }


// Path: app/src/main/java/org/freemp/droid/playlist/TaskGetPlaylist.java
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Environment;
import android.preference.PreferenceManager;
import org.freemp.droid.Constants;
import java.lang.ref.WeakReference;

package org.freemp.droid.playlist;





/**
 * Created by recoil on 01.06.14.
 */
public class TaskGetPlaylist extends AsyncTask {

    private final WeakReference<Activity> mActivity;
    private final WeakReference<OnTaskGetPlaylist> mOnTaskGetPlaylist;
    private int type;
    private boolean refresh;

    public TaskGetPlaylist(Activity activity, int type, boolean refresh, OnTaskGetPlaylist onTaskGetPlaylist) {

        mActivity = new WeakReference<Activity>(activity);
        mOnTaskGetPlaylist = new WeakReference<OnTaskGetPlaylist>(onTaskGetPlaylist);
        String scanDir = PreferenceManager.getDefaultSharedPreferences(mActivity.get()).getString("scanDir", Environment.getExternalStorageDirectory().getAbsolutePath().toString());
        //Log.w("ScanDir is:",scanDir);
        if (scanDir == null || scanDir.equals("/") || scanDir.equals("/sdcard") || scanDir.equals("/storage/emulated/0")) {
            type = 0;
        }
        this.type = type;
        this.refresh = refresh;
    }

    @Override
    protected Object doInBackground(Object... params) {
        Activity activity = mActivity.get();
        if (null == activity) {
            return null;
        }
        switch (this.type) {
            case Constants.TYPE_MS: