docs: static void tryAutoAttaching(final SlotReference slot) {
          if (!MetadataFinder.getInstance().getMountedMediaSlots().contains(slot)) {
              logger.error("Unable to auto-attach cache to empty slot {}", slot);
              return;
          }
          if (MetadataFinder.getInstance().getMetadataCache(slot) != null) {
              logger.info("Not auto-attaching to slot {}; already has a cache attached.", slot);
              return;
          }
          if (MetadataFinder.getInstance().getAutoAttachCacheFiles().isEmpty()) {
              logger.debug("No auto-attach files configured.");
              return;
          }
  
          new Thread(new Runnable() {
              @Override
              public void run() {
                  try {
                      Thread.sleep(5);  // Give us a chance to find out what type of media is in the new mount.
                      final MediaDetails details = MetadataFinder.getInstance().getMediaDetailsFor(slot);
                      if (details != null && details.mediaType == CdjStatus.TrackType.REKORDBOX) {
                          // First stage attempt: See if we can match based on stored media details, which is both more reliable and
                          // less disruptive than trying to sample the player database to compare entries.
                          boolean attached = false;
                          for (File file : MetadataFinder.getInstance().getAutoAttachCacheFiles()) {
                              final MetadataCache cache = new MetadataCache(file);
                              try {
                                  if (cache.sourceMedia != null && cache.sourceMedia.hashKey().equals(details.hashKey())) {
                                      // We found a solid match, no need to probe tracks.
                                      final boolean changed = cache.sourceMedia.hasChanged(details);
                                      logger.info("Auto-attaching metadata cache " + cache.getName() + " to slot " + slot +
                                              " based on media details " + (changed? "(changed since created)!" : "(unchanged)."));
                                      MetadataFinder.getInstance().attachMetadataCacheInternal(slot, cache);
                                      attached = true;
                                      return;
                                  }
                              } finally {
                                  if (!attached) {
                                      cache.close();
                                  }
                              }
                          }
  
                          // Could not match based on media details; fall back to older method based on probing track metadata.
                          ConnectionManager.ClientTask<Object> task = new ConnectionManager.ClientTask<Object>() {
                              @Override
                              public Object useClient(Client client) throws Exception {
                                  tryAutoAttachingWithConnection(slot, client);
                                  return null;
                              }
                          };
                          ConnectionManager.getInstance().invokeWithClientSession(slot.player, task, "trying to auto-attach metadata cache");
                      }
                  } catch (Exception e) {
                      logger.error("Problem trying to auto-attach metadata cache for slot " + slot, e);
                  }
  
              }
          }, "Metadata cache file auto-attachment attempt").start();
      }