@@ -230,18 +230,13 @@ private void downloadAssets(Project project, ApiManifest apiManifest, String non
230230 String hash = Utils .sha1Hex (url );
231231 hashes .add (hash );
232232
233- String nightModeFileName = null ;
234- if (nonRootIncludedFileName != null ) {
235- nightModeFileName = getNightModeFileName (nonRootIncludedFileName );
236- }
237- boolean forceInclude = FilenameUtils .removeExtension (apiAsset .name ).equals (nightModeFileName );
238233 String ext = FilenameUtils .getExtension (apiAsset .name );
239- if (!ext .equals ("svg" ) && !forceInclude ) {
234+ if (!ext .equals ("svg" ) && !ext . equals ( "jpg" ) && ! ext . equals ( "webp" ) ) {
240235 continue ;
241236 }
242237
243238 // exclude assets that are not in the root when not explicitly requested
244- if (apiAsset .name .contains ("/" ) && !forceInclude ) {
239+ if (apiAsset .name .contains ("/" ) && !apiAsset . name . equals ( nonRootIncludedFileName ) ) {
245240 continue ;
246241 }
247242
@@ -362,11 +357,6 @@ public Bitmap getBitmap(String name, Type type) {
362357 }
363358 }
364359
365- private String getNightModeFileName (String fileName ) {
366- boolean nightMode = isNightModeActive (Snabble .getInstance ().getApplication ());
367- return FilenameUtils .removeExtension (fileName ) + (nightMode ? "_dark" : "" );
368- }
369-
370360 private Asset getAsset (String name , Type type ) {
371361 // currently a limitation due to asynchronous reads and saves,
372362 // could be solved with careful locking
@@ -378,7 +368,9 @@ private Asset getAsset(String name, Type type) {
378368 return null ;
379369 }
380370
381- String fileName = getNightModeFileName (name );
371+ boolean nightMode = isNightModeActive (Snabble .getInstance ().getApplication ());
372+
373+ String fileName = FilenameUtils .removeExtension (name ) + (nightMode ? "_dark" : "" );
382374
383375 switch (type ) {
384376 case SVG :
0 commit comments