original_docstring: 
          _searching_thread is spawned as a seperate daemon thread from the main process
          It executes its search every self.search_frequency seconds in order to update
          the music library as it is changed.
          # TODO this can probably be refactored with discord.py tasks:
          https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html
          
docstring: _searching_thread is spawned as a seperate daemon thread from the main process
  It executes its search every self.search_frequency seconds in order to update
  the music library as it is changed.
docstring_tokens: _searching_thread is spawned as a seperate daemon thread from the main process It executes its search every self . search_frequency seconds in order to update the music library as it is changed .
code: def _searching_thread(self):
          '''
          _searching_thread is spawned as a seperate daemon thread from the main process
          It executes its search every self.search_frequency seconds in order to update
          the music library as it is changed.
          # TODO this can probably be refactored with discord.py tasks:
          https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html
          '''
          while (True):
              self.bot.log.debug("_searching_thread Executing")
  
              self.local_library = []
              rootdir = self.local_path
              rootdir = rootdir.rstrip(os.sep)
              for path, _, files in os.walk(rootdir):
                  filterd_files = [
                      f"{path}/{file}" for file in files
                      if pathlib.Path(file).suffix in self.audio_types
                  ]
                  self.local_library += filterd_files
  
              self.bot.log.debug(
                  f"_searching_thread Completed. Loaded {len(self.local_library)} songs."
              )
  
              # inital_lock is used to lock the music function until the first search after
              # starting the bot is completed. Otherwise searches would fail or return partial
              # results until the initial search is completed.
              # TODO maybe we can put something into a pre invoke method to populate the local
              # library before the bot accepts music commands
              if self.inital_lock:
                  self.inital_lock = False
  
              sleep(self.search_frequency)
code_tokens: def _searching_thread ( self ) : while ( True ) : self . bot . log . debug ( "_searching_thread Executing" ) self . local_library = [ ] rootdir = self . local_path rootdir = rootdir . rstrip ( os . sep ) for path , _ , files in os . walk ( rootdir ) : filterd_files = [ f"{path}/{file}" for file in files if pathlib . Path ( file ) . suffix in self . audio_types ] self . local_library += filterd_files self . bot . log . debug ( f"_searching_thread Completed. Loaded {len(self.local_library)} songs." ) if self . inital_lock : self . inital_lock = False sleep ( self . search_frequency )
short_docstring: _searching_thread is spawned as a seperate daemon thread from the main process
  It executes its search every self.search_frequency seconds in order to update
  the music library as it is changed.
short_docstring_tokens: _searching_thread is spawned as a seperate daemon thread from the main process It executes its search every self . search_frequency seconds in order to update the music library as it is changed .
comment: '''
          _searching_thread is spawned as a seperate daemon thread from the main process
          It executes its search every self.search_frequency seconds in order to update
          the music library as it is changed.
          # TODO this can probably be refactored with discord.py tasks:
          https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html
          '''$SEP$# inital_lock is used to lock the music function until the first search after$SEP$# starting the bot is completed. Otherwise searches would fail or return partial$SEP$# results until the initial search is completed.$SEP$# TODO maybe we can put something into a pre invoke method to populate the local$SEP$# library before the bot accepts music commands