@@ -187,6 +187,7 @@ public void onCreate() {
187187 public void onReceive (Context context , Intent intent ) {
188188 int total = intent .getIntExtra ("files_indexed" , 0 );
189189 cacheFilesIndexed = total ;
190+ cacheCurrentFolder = "" ; // Clear folder when indexing completes
190191 showNotification (); // Update notification with final cache status
191192 }
192193 };
@@ -391,13 +392,20 @@ private void showNotification() {
391392
392393 // Duration cache status
393394 SAFCacheManager cacheManager = SAFCacheManager .getInstance (this );
394- if (cacheManager .isPreloading ()) {
395+ boolean isPreloading = cacheManager .isPreloading ();
396+ YaaccLogger .d (getClass ().getName (), "showNotification: isPreloading=" + isPreloading + ", cacheSize=" + cacheManager .getCacheSize () + ", filesIndexed=" + cacheFilesIndexed );
397+
398+ if (isPreloading ) {
395399 statusBuilder .append (" | ⏳ Indexing: " ).append (cacheFilesIndexed );
396400 if (!cacheCurrentFolder .isEmpty ()) {
397401 statusBuilder .append (" (" ).append (cacheCurrentFolder ).append (")" );
398402 }
403+ YaaccLogger .d (getClass ().getName (), "Notification: showing indexing progress - " + cacheFilesIndexed + " files" );
399404 } else if (cacheManager .getCacheSize () > 0 ) {
400405 statusBuilder .append (" | ✓ Cache: " ).append (cacheManager .getCacheSize ());
406+ YaaccLogger .d (getClass ().getName (), "Notification: showing cache size - " + cacheManager .getCacheSize () + " items" );
407+ } else {
408+ YaaccLogger .d (getClass ().getName (), "Notification: no cache or indexing (isPreloading=" + isPreloading + ", cacheSize=" + cacheManager .getCacheSize () + ")" );
401409 }
402410
403411 NotificationCompat .Builder mBuilder = new NotificationCompat .Builder (this , Yaacc .NOTIFICATION_CHANNEL_ID )
0 commit comments