TEST - Context check before cache dir request

This commit is contained in:
CappielloAntonio 2021-08-25 17:40:32 +02:00
parent 8810eecd10
commit aef220e094
8 changed files with 8 additions and 14 deletions

View file

@ -139,6 +139,5 @@ public class BrowsingClient {
private Cache getCache() { private Cache getCache() {
int cacheSize = 10 * 1024 * 1024; int cacheSize = 10 * 1024 * 1024;
return new Cache(context.getCacheDir(), cacheSize); return context != null ? new Cache(context.getCacheDir(), cacheSize) : null; }
}
} }

View file

@ -74,6 +74,5 @@ public class MediaAnnotationClient {
private Cache getCache() { private Cache getCache() {
int cacheSize = 10 * 1024 * 1024; int cacheSize = 10 * 1024 * 1024;
return new Cache(context.getCacheDir(), cacheSize); return context != null ? new Cache(context.getCacheDir(), cacheSize) : null; }
}
} }

View file

@ -65,6 +65,5 @@ public class MediaLibraryScanningClient {
private Cache getCache() { private Cache getCache() {
int cacheSize = 10 * 1024 * 1024; int cacheSize = 10 * 1024 * 1024;
return new Cache(context.getCacheDir(), cacheSize); return context != null ? new Cache(context.getCacheDir(), cacheSize) : null; }
}
} }

View file

@ -64,6 +64,5 @@ public class MediaRetrievalClient {
private Cache getCache() { private Cache getCache() {
int cacheSize = 10 * 1024 * 1024; int cacheSize = 10 * 1024 * 1024;
return new Cache(context.getCacheDir(), cacheSize); return context != null ? new Cache(context.getCacheDir(), cacheSize) : null; }
}
} }

View file

@ -81,6 +81,5 @@ public class PlaylistClient {
private Cache getCache() { private Cache getCache() {
int cacheSize = 10 * 1024 * 1024; int cacheSize = 10 * 1024 * 1024;
return new Cache(context.getCacheDir(), cacheSize); return context != null ? new Cache(context.getCacheDir(), cacheSize) : null; }
}
} }

View file

@ -64,6 +64,5 @@ public class SearchingClient {
private Cache getCache() { private Cache getCache() {
int cacheSize = 10 * 1024 * 1024; int cacheSize = 10 * 1024 * 1024;
return new Cache(context.getCacheDir(), cacheSize); return context != null ? new Cache(context.getCacheDir(), cacheSize) : null; }
}
} }

View file

@ -64,6 +64,6 @@ public class SystemClient {
private Cache getCache() { private Cache getCache() {
int cacheSize = 10 * 1024 * 1024; int cacheSize = 10 * 1024 * 1024;
return new Cache(context.getCacheDir(), cacheSize); return context != null ? new Cache(context.getCacheDir(), cacheSize) : null;
} }
} }

View file

@ -118,7 +118,7 @@ public class ArtistPageFragment extends Fragment {
if (bind != null) bind.bioMoreTextViewClickable.setVisibility(artist.getLastfm() != null ? View.VISIBLE : View.GONE); if (bind != null) bind.bioMoreTextViewClickable.setVisibility(artist.getLastfm() != null ? View.VISIBLE : View.GONE);
CustomGlideRequest.Builder CustomGlideRequest.Builder
.from(requireContext(), /*artistPageViewModel.getArtist().getId()*/ null, CustomGlideRequest.ARTIST_PIC, artist.getImageUrl()) .from(requireContext(), artistPageViewModel.getArtist().getId(), CustomGlideRequest.ARTIST_PIC, /*artist.getImageUrl()*/ null)
.build() .build()
.into(bind.artistBackdropImageView); .into(bind.artistBackdropImageView);