mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-10-10 05:07:39 +00:00
Wrap debug log in if(DEBUG)
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package org.schabi.newpipe.player.helper;
|
package org.schabi.newpipe.player.helper;
|
||||||
|
|
||||||
|
import static org.schabi.newpipe.MainActivity.DEBUG;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -199,7 +201,9 @@ public class PlayerDataSource {
|
|||||||
private static void instantiateCacheIfNeeded(final Context context) {
|
private static void instantiateCacheIfNeeded(final Context context) {
|
||||||
if (cache == null) {
|
if (cache == null) {
|
||||||
final File cacheDir = new File(context.getExternalCacheDir(), CACHE_FOLDER_NAME);
|
final File cacheDir = new File(context.getExternalCacheDir(), CACHE_FOLDER_NAME);
|
||||||
Log.d(TAG, "instantiateCacheIfNeeded: cacheDir = " + cacheDir.getAbsolutePath());
|
if (DEBUG) {
|
||||||
|
Log.d(TAG, "instantiateCacheIfNeeded: cacheDir = " + cacheDir.getAbsolutePath());
|
||||||
|
}
|
||||||
if (!cacheDir.exists() && !cacheDir.mkdir()) {
|
if (!cacheDir.exists() && !cacheDir.mkdir()) {
|
||||||
Log.w(TAG, "instantiateCacheIfNeeded: could not create cache dir");
|
Log.w(TAG, "instantiateCacheIfNeeded: could not create cache dir");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user