Removed all Log.i

This commit is contained in:
Karim Abou Zeid 2015-03-05 17:54:41 +01:00
commit f6fce0355c
10 changed files with 2 additions and 36 deletions

View file

@ -275,7 +275,6 @@ public class MusicPlayerRemote implements OnMusicRemoteEventListener {
position = restoredPosition;
notifyOnMusicRemoteEventListeners(MusicRemoteEvent.STATE_RESTORED);
Log.i(TAG, "restored last state");
} catch (IOException | ClassNotFoundException | ClassCastException e) {
Log.e(TAG, "error while restoring music service state", e);
playingQueue = new ArrayList<>();

View file

@ -30,21 +30,18 @@ public class LastFMAlbumImageLoader {
if (queryAlbum != null) {
String albumJSON = AlbumJSONStore.getInstance(context).getAlbumJSON(queryAlbum + queryArtist);
if (albumJSON != null) {
Log.i(TAG, queryAlbum + " by " + queryArtist + " is in cache.");
try {
loadAlbumImageFromJSON(new JSONObject(albumJSON), callback);
} catch (JSONException e) {
Log.e(TAG, "Error while parsing string from cache to JSONObject", e);
}
} else {
Log.i(TAG, queryAlbum + " is not in cache.");
downloadAlbumImage(context, queryAlbum, queryArtist, callback);
}
}
}
private static void loadAlbumImageFromJSON(JSONObject jsonObject, final AlbumImageLoaderCallback callback) {
Log.i(TAG, "Applying album art...");
String url = LastFMAlbumInfoUtil.getAlbumImageUrlFromJSON(jsonObject);
if (!url.trim().equals("")) {
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) {
Log.i(TAG, "Downloading details for " + album);
App app = (App) context.getApplicationContext();
String albumUrl = LastFMAlbumInfoUtil.getAlbumUrl(album, artist);
JsonObjectRequest albumInfoJSONRequest = new JsonObjectRequest(0, albumUrl, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.i(TAG, "Download was successful!");
LastFMAlbumInfoUtil.saveAlbumJSONDataToCacheAndDisk(context, album, artist, response);
loadAlbumImageFromJSON(response, callback);
}

View file

@ -81,7 +81,6 @@ public class LastFMAlbumInfoUtil {
}
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());
}
}

View file

@ -22,7 +22,6 @@ public class LastFMArtistBiographyLoader {
if (queryArtist != null) {
String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist);
if (artistJSON != null) {
Log.i(TAG, queryArtist + " is in cache.");
try {
JSONObject json = new JSONObject(artistJSON);
String bio = LastFMArtistInfoUtil.getArtistBiographyFromJSON(json);
@ -31,20 +30,17 @@ public class LastFMArtistBiographyLoader {
Log.e(TAG, "Error while parsing bio from cache to JSONObject", e);
}
} else {
Log.i(TAG, queryArtist + " is not in cache.");
downloadArtistBio(context, queryArtist, 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();
String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist);
JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.i(TAG, "Download was successful!");
LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response);
String bio = LastFMArtistInfoUtil.getArtistBiographyFromJSON(response);
callback.onArtistBioLoaded(bio);

View file

@ -33,25 +33,18 @@ public class LastFMArtistImageLoader {
if (queryArtist != null) {
String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist);
if (artistJSON != null && !forceDownload) {
Log.i(TAG, queryArtist + " is in cache.");
try {
loadArtistImageFromJSON(new JSONObject(artistJSON), callback);
} catch (JSONException e) {
Log.e(TAG, "Error while parsing string from cache to JSONObject", e);
}
} else {
if(forceDownload){
Log.i(TAG, queryArtist + " force re-download");
} else {
Log.i(TAG, queryArtist + " is not in cache.");
}
downloadArtistJSONAndStartImageDownload(context, queryArtist, callback);
}
}
}
private static void loadArtistImageFromJSON(JSONObject jsonObject, final ArtistImageLoaderCallback callback) {
Log.i(TAG, "Applying artist art...");
String url = LastFMArtistInfoUtil.getArtistImageUrlFromJSON(jsonObject);
if (!url.trim().equals("")) {
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) {
Log.i(TAG, "Downloading details for " + artist);
App app = (App) context.getApplicationContext();
String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist);
JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.i(TAG, "Download was successful!");
LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response);
loadArtistImageFromJSON(response, callback);
}

View file

@ -83,13 +83,12 @@ public class LastFMArtistInfoUtil {
try {
return rootJSON.getJSONObject("artist").getJSONObject("bio").getString("content");
} 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 "";
}
}
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).addArtistJSON(artist, jsonObject.toString());
}

View file

@ -33,25 +33,18 @@ public class LastFMArtistThumbnailLoader {
if (queryArtist != null) {
String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist);
if (artistJSON != null && !forceDownload) {
Log.i(TAG, queryArtist + " is in cache.");
try {
loadArtistThumbnailFromJSON(new JSONObject(artistJSON), callback);
} catch (JSONException e) {
Log.e(TAG, "Error while parsing string from cache to JSONObject", e);
}
} else {
if(forceDownload){
Log.i(TAG, queryArtist + " force re-download");
} else {
Log.i(TAG, queryArtist + " is not in cache.");
}
downloadArtistThumbnail(context, queryArtist, callback);
}
}
}
private static void loadArtistThumbnailFromJSON(JSONObject jsonObject, final ArtistThumbnailLoaderCallback callback) {
Log.i(TAG, "Applying artist thumbnail...");
String url = LastFMArtistInfoUtil.getArtistThumbnailUrlFromJSON(jsonObject);
if (!url.trim().equals("")) {
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) {
Log.i(TAG, "Downloading details for " + artist);
App app = (App) context.getApplicationContext();
String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist);
JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.i(TAG, "Download was successful!");
LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response);
loadArtistThumbnailFromJSON(response, callback);
}

View file

@ -15,7 +15,6 @@ public class MediaButtonIntentReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
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);
if (event == null)
return;

View file

@ -170,7 +170,6 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
@Override
public IBinder onBind(Intent intent) {
Log.i(TAG, "onBind");
return musicBind;
}
@ -226,7 +225,6 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
try {
InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_PLAYING_QUEUE, playingQueue);
InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_ORIGINAL_PLAYING_QUEUE, originalPlayingQueue);
Log.i(TAG, "saved current queue state");
} catch (IOException 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() {
try {
InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_POSITION_IN_QUEUE, getPosition());
Log.i(TAG, "saved current position state");
} catch (IOException e) {
Log.e(TAG, "error while saving music service position state", e);
}