Removed all Log.i
This commit is contained in:
parent
b7bac47f7e
commit
f6fce0355c
10 changed files with 2 additions and 36 deletions
|
|
@ -55,7 +55,7 @@ dependencies {
|
||||||
compile 'com.github.ksoichiro:android-observablescrollview:1.3.0'
|
compile 'com.github.ksoichiro:android-observablescrollview:1.3.0'
|
||||||
compile 'com.mcxiaoke.volley:library:1.0.+'
|
compile 'com.mcxiaoke.volley:library:1.0.+'
|
||||||
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
|
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
|
||||||
compile 'com.afollestad:material-dialogs:0.6.3.0'
|
compile 'com.afollestad:material-dialogs:0.6.3.4'
|
||||||
compile('com.crashlytics.sdk.android:crashlytics:2.2.1@aar') {
|
compile('com.crashlytics.sdk.android:crashlytics:2.2.1@aar') {
|
||||||
transitive = true;
|
transitive = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,6 @@ public class MusicPlayerRemote implements OnMusicRemoteEventListener {
|
||||||
position = restoredPosition;
|
position = restoredPosition;
|
||||||
|
|
||||||
notifyOnMusicRemoteEventListeners(MusicRemoteEvent.STATE_RESTORED);
|
notifyOnMusicRemoteEventListeners(MusicRemoteEvent.STATE_RESTORED);
|
||||||
Log.i(TAG, "restored last state");
|
|
||||||
} catch (IOException | ClassNotFoundException | ClassCastException e) {
|
} catch (IOException | ClassNotFoundException | ClassCastException e) {
|
||||||
Log.e(TAG, "error while restoring music service state", e);
|
Log.e(TAG, "error while restoring music service state", e);
|
||||||
playingQueue = new ArrayList<>();
|
playingQueue = new ArrayList<>();
|
||||||
|
|
|
||||||
|
|
@ -30,21 +30,18 @@ public class LastFMAlbumImageLoader {
|
||||||
if (queryAlbum != null) {
|
if (queryAlbum != null) {
|
||||||
String albumJSON = AlbumJSONStore.getInstance(context).getAlbumJSON(queryAlbum + queryArtist);
|
String albumJSON = AlbumJSONStore.getInstance(context).getAlbumJSON(queryAlbum + queryArtist);
|
||||||
if (albumJSON != null) {
|
if (albumJSON != null) {
|
||||||
Log.i(TAG, queryAlbum + " by " + queryArtist + " is in cache.");
|
|
||||||
try {
|
try {
|
||||||
loadAlbumImageFromJSON(new JSONObject(albumJSON), callback);
|
loadAlbumImageFromJSON(new JSONObject(albumJSON), callback);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
Log.e(TAG, "Error while parsing string from cache to JSONObject", e);
|
Log.e(TAG, "Error while parsing string from cache to JSONObject", e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.i(TAG, queryAlbum + " is not in cache.");
|
|
||||||
downloadAlbumImage(context, queryAlbum, queryArtist, callback);
|
downloadAlbumImage(context, queryAlbum, queryArtist, callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadAlbumImageFromJSON(JSONObject jsonObject, final AlbumImageLoaderCallback callback) {
|
private static void loadAlbumImageFromJSON(JSONObject jsonObject, final AlbumImageLoaderCallback callback) {
|
||||||
Log.i(TAG, "Applying album art...");
|
|
||||||
String url = LastFMAlbumInfoUtil.getAlbumImageUrlFromJSON(jsonObject);
|
String url = LastFMAlbumInfoUtil.getAlbumImageUrlFromJSON(jsonObject);
|
||||||
if (!url.trim().equals("")) {
|
if (!url.trim().equals("")) {
|
||||||
DisplayImageOptions options = new DisplayImageOptions.Builder()
|
DisplayImageOptions options = new DisplayImageOptions.Builder()
|
||||||
|
|
@ -84,13 +81,11 @@ public class LastFMAlbumImageLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void downloadAlbumImage(final Context context, final String album, final String artist, final AlbumImageLoaderCallback callback) {
|
private static void downloadAlbumImage(final Context context, final String album, final String artist, final AlbumImageLoaderCallback callback) {
|
||||||
Log.i(TAG, "Downloading details for " + album);
|
|
||||||
App app = (App) context.getApplicationContext();
|
App app = (App) context.getApplicationContext();
|
||||||
String albumUrl = LastFMAlbumInfoUtil.getAlbumUrl(album, artist);
|
String albumUrl = LastFMAlbumInfoUtil.getAlbumUrl(album, artist);
|
||||||
JsonObjectRequest albumInfoJSONRequest = new JsonObjectRequest(0, albumUrl, null, new Response.Listener<JSONObject>() {
|
JsonObjectRequest albumInfoJSONRequest = new JsonObjectRequest(0, albumUrl, null, new Response.Listener<JSONObject>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(JSONObject response) {
|
public void onResponse(JSONObject response) {
|
||||||
Log.i(TAG, "Download was successful!");
|
|
||||||
LastFMAlbumInfoUtil.saveAlbumJSONDataToCacheAndDisk(context, album, artist, response);
|
LastFMAlbumInfoUtil.saveAlbumJSONDataToCacheAndDisk(context, album, artist, response);
|
||||||
loadAlbumImageFromJSON(response, callback);
|
loadAlbumImageFromJSON(response, callback);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@ public class LastFMAlbumInfoUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveAlbumJSONDataToCacheAndDisk(Context context, String album, String artist, JSONObject jsonObject) {
|
public static void saveAlbumJSONDataToCacheAndDisk(Context context, String album, String artist, JSONObject jsonObject) {
|
||||||
Log.i(TAG, "Saving new JSON album data for " + album + "...");
|
|
||||||
AlbumJSONStore.getInstance(context).addAlbumJSON(album + artist, jsonObject.toString());
|
AlbumJSONStore.getInstance(context).addAlbumJSON(album + artist, jsonObject.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ public class LastFMArtistBiographyLoader {
|
||||||
if (queryArtist != null) {
|
if (queryArtist != null) {
|
||||||
String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist);
|
String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist);
|
||||||
if (artistJSON != null) {
|
if (artistJSON != null) {
|
||||||
Log.i(TAG, queryArtist + " is in cache.");
|
|
||||||
try {
|
try {
|
||||||
JSONObject json = new JSONObject(artistJSON);
|
JSONObject json = new JSONObject(artistJSON);
|
||||||
String bio = LastFMArtistInfoUtil.getArtistBiographyFromJSON(json);
|
String bio = LastFMArtistInfoUtil.getArtistBiographyFromJSON(json);
|
||||||
|
|
@ -31,20 +30,17 @@ public class LastFMArtistBiographyLoader {
|
||||||
Log.e(TAG, "Error while parsing bio from cache to JSONObject", e);
|
Log.e(TAG, "Error while parsing bio from cache to JSONObject", e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.i(TAG, queryArtist + " is not in cache.");
|
|
||||||
downloadArtistBio(context, queryArtist, callback);
|
downloadArtistBio(context, queryArtist, callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void downloadArtistBio(final Context context, final String artist, final ArtistBioLoaderCallback callback) {
|
private static void downloadArtistBio(final Context context, final String artist, final ArtistBioLoaderCallback callback) {
|
||||||
Log.i(TAG, "Downloading details for " + artist);
|
|
||||||
App app = (App) context.getApplicationContext();
|
App app = (App) context.getApplicationContext();
|
||||||
String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist);
|
String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist);
|
||||||
JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener<JSONObject>() {
|
JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener<JSONObject>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(JSONObject response) {
|
public void onResponse(JSONObject response) {
|
||||||
Log.i(TAG, "Download was successful!");
|
|
||||||
LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response);
|
LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response);
|
||||||
String bio = LastFMArtistInfoUtil.getArtistBiographyFromJSON(response);
|
String bio = LastFMArtistInfoUtil.getArtistBiographyFromJSON(response);
|
||||||
callback.onArtistBioLoaded(bio);
|
callback.onArtistBioLoaded(bio);
|
||||||
|
|
|
||||||
|
|
@ -33,25 +33,18 @@ public class LastFMArtistImageLoader {
|
||||||
if (queryArtist != null) {
|
if (queryArtist != null) {
|
||||||
String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist);
|
String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist);
|
||||||
if (artistJSON != null && !forceDownload) {
|
if (artistJSON != null && !forceDownload) {
|
||||||
Log.i(TAG, queryArtist + " is in cache.");
|
|
||||||
try {
|
try {
|
||||||
loadArtistImageFromJSON(new JSONObject(artistJSON), callback);
|
loadArtistImageFromJSON(new JSONObject(artistJSON), callback);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
Log.e(TAG, "Error while parsing string from cache to JSONObject", e);
|
Log.e(TAG, "Error while parsing string from cache to JSONObject", e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(forceDownload){
|
|
||||||
Log.i(TAG, queryArtist + " force re-download");
|
|
||||||
} else {
|
|
||||||
Log.i(TAG, queryArtist + " is not in cache.");
|
|
||||||
}
|
|
||||||
downloadArtistJSONAndStartImageDownload(context, queryArtist, callback);
|
downloadArtistJSONAndStartImageDownload(context, queryArtist, callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadArtistImageFromJSON(JSONObject jsonObject, final ArtistImageLoaderCallback callback) {
|
private static void loadArtistImageFromJSON(JSONObject jsonObject, final ArtistImageLoaderCallback callback) {
|
||||||
Log.i(TAG, "Applying artist art...");
|
|
||||||
String url = LastFMArtistInfoUtil.getArtistImageUrlFromJSON(jsonObject);
|
String url = LastFMArtistInfoUtil.getArtistImageUrlFromJSON(jsonObject);
|
||||||
if (!url.trim().equals("")) {
|
if (!url.trim().equals("")) {
|
||||||
ImageLoader.getInstance().loadImage(url, ImageLoaderUtil.getCacheOnDiskOptions(), new ImageLoadingListener() {
|
ImageLoader.getInstance().loadImage(url, ImageLoaderUtil.getCacheOnDiskOptions(), new ImageLoadingListener() {
|
||||||
|
|
@ -81,13 +74,11 @@ public class LastFMArtistImageLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void downloadArtistJSONAndStartImageDownload(final Context context, final String artist, final ArtistImageLoaderCallback callback) {
|
private static void downloadArtistJSONAndStartImageDownload(final Context context, final String artist, final ArtistImageLoaderCallback callback) {
|
||||||
Log.i(TAG, "Downloading details for " + artist);
|
|
||||||
App app = (App) context.getApplicationContext();
|
App app = (App) context.getApplicationContext();
|
||||||
String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist);
|
String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist);
|
||||||
JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener<JSONObject>() {
|
JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener<JSONObject>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(JSONObject response) {
|
public void onResponse(JSONObject response) {
|
||||||
Log.i(TAG, "Download was successful!");
|
|
||||||
LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response);
|
LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response);
|
||||||
loadArtistImageFromJSON(response, callback);
|
loadArtistImageFromJSON(response, callback);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,13 +83,12 @@ public class LastFMArtistInfoUtil {
|
||||||
try {
|
try {
|
||||||
return rootJSON.getJSONObject("artist").getJSONObject("bio").getString("content");
|
return rootJSON.getJSONObject("artist").getJSONObject("bio").getString("content");
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
//Log.e(TAG, "Error while getting artist biografie from JSON parameter!", e);
|
//Log.e(TAG, "Error while getting artist biography from JSON parameter!", e);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveArtistJSONDataToCacheAndDisk(Context context, String artist, JSONObject jsonObject) {
|
public static void saveArtistJSONDataToCacheAndDisk(Context context, String artist, JSONObject jsonObject) {
|
||||||
Log.i(TAG, "Saving new JSON artist data for " + artist + "...");
|
|
||||||
ArtistJSONStore.getInstance(context).removeItem(artist);
|
ArtistJSONStore.getInstance(context).removeItem(artist);
|
||||||
ArtistJSONStore.getInstance(context).addArtistJSON(artist, jsonObject.toString());
|
ArtistJSONStore.getInstance(context).addArtistJSON(artist, jsonObject.toString());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,25 +33,18 @@ public class LastFMArtistThumbnailLoader {
|
||||||
if (queryArtist != null) {
|
if (queryArtist != null) {
|
||||||
String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist);
|
String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist);
|
||||||
if (artistJSON != null && !forceDownload) {
|
if (artistJSON != null && !forceDownload) {
|
||||||
Log.i(TAG, queryArtist + " is in cache.");
|
|
||||||
try {
|
try {
|
||||||
loadArtistThumbnailFromJSON(new JSONObject(artistJSON), callback);
|
loadArtistThumbnailFromJSON(new JSONObject(artistJSON), callback);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
Log.e(TAG, "Error while parsing string from cache to JSONObject", e);
|
Log.e(TAG, "Error while parsing string from cache to JSONObject", e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(forceDownload){
|
|
||||||
Log.i(TAG, queryArtist + " force re-download");
|
|
||||||
} else {
|
|
||||||
Log.i(TAG, queryArtist + " is not in cache.");
|
|
||||||
}
|
|
||||||
downloadArtistThumbnail(context, queryArtist, callback);
|
downloadArtistThumbnail(context, queryArtist, callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadArtistThumbnailFromJSON(JSONObject jsonObject, final ArtistThumbnailLoaderCallback callback) {
|
private static void loadArtistThumbnailFromJSON(JSONObject jsonObject, final ArtistThumbnailLoaderCallback callback) {
|
||||||
Log.i(TAG, "Applying artist thumbnail...");
|
|
||||||
String url = LastFMArtistInfoUtil.getArtistThumbnailUrlFromJSON(jsonObject);
|
String url = LastFMArtistInfoUtil.getArtistThumbnailUrlFromJSON(jsonObject);
|
||||||
if (!url.trim().equals("")) {
|
if (!url.trim().equals("")) {
|
||||||
ImageLoader.getInstance().loadImage(url, ImageLoaderUtil.getCacheOnDiskOptions(), new ImageLoadingListener() {
|
ImageLoader.getInstance().loadImage(url, ImageLoaderUtil.getCacheOnDiskOptions(), new ImageLoadingListener() {
|
||||||
|
|
@ -81,13 +74,11 @@ public class LastFMArtistThumbnailLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void downloadArtistThumbnail(final Context context, final String artist, final ArtistThumbnailLoaderCallback callback) {
|
private static void downloadArtistThumbnail(final Context context, final String artist, final ArtistThumbnailLoaderCallback callback) {
|
||||||
Log.i(TAG, "Downloading details for " + artist);
|
|
||||||
App app = (App) context.getApplicationContext();
|
App app = (App) context.getApplicationContext();
|
||||||
String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist);
|
String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist);
|
||||||
JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener<JSONObject>() {
|
JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener<JSONObject>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(JSONObject response) {
|
public void onResponse(JSONObject response) {
|
||||||
Log.i(TAG, "Download was successful!");
|
|
||||||
LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response);
|
LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response);
|
||||||
loadArtistThumbnailFromJSON(response, callback);
|
loadArtistThumbnailFromJSON(response, callback);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ public class MediaButtonIntentReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent.getAction().equals(Intent.ACTION_MEDIA_BUTTON)) {
|
if (intent.getAction().equals(Intent.ACTION_MEDIA_BUTTON)) {
|
||||||
Log.i(TAG, intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT).toString());
|
|
||||||
final KeyEvent event = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
|
final KeyEvent event = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
|
||||||
if (event == null)
|
if (event == null)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,6 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBinder onBind(Intent intent) {
|
public IBinder onBind(Intent intent) {
|
||||||
Log.i(TAG, "onBind");
|
|
||||||
return musicBind;
|
return musicBind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -226,7 +225,6 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
|
||||||
try {
|
try {
|
||||||
InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_PLAYING_QUEUE, playingQueue);
|
InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_PLAYING_QUEUE, playingQueue);
|
||||||
InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_ORIGINAL_PLAYING_QUEUE, originalPlayingQueue);
|
InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_ORIGINAL_PLAYING_QUEUE, originalPlayingQueue);
|
||||||
Log.i(TAG, "saved current queue state");
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e(TAG, "error while saving music service queue state", e);
|
Log.e(TAG, "error while saving music service queue state", e);
|
||||||
}
|
}
|
||||||
|
|
@ -238,7 +236,6 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_POSITION_IN_QUEUE, getPosition());
|
InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_POSITION_IN_QUEUE, getPosition());
|
||||||
Log.i(TAG, "saved current position state");
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e(TAG, "error while saving music service position state", e);
|
Log.e(TAG, "error while saving music service position state", e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue