Search for given string as an existing entry in the database file name
    table or, if no match is found, as a show name from the TV guide.

    If an exact match is not found in the database the user can accept
    or decline the best match from the TV guide or can provide an alternate
    match to lookup.

    Parameters
    ----------
      stringSearch : string
        String to look up in database or guide.

      origStringSearch : string [optional: default = None]
        Original search string, used by recusive function calls.

    Returns
    ----------
      tvfile.ShowInfo or None
        If no show id could be found this returns None, otherwise
        it returns a tvfile.ShowInfo object containing show name
        and show id.

def _GetShowID(self, stringSearch, origStringSearch = None):
    """
    Search for given string as an existing entry in the database file name
    table or, if no match is found, as a show name from the TV guide.

    If an exact match is not found in the database the user can accept
    or decline the best match from the TV guide or can provide an alternate
    match to lookup.

    Parameters
    ----------
      stringSearch : string
        String to look up in database or guide.

      origStringSearch : string [optional: default = None]
        Original search string, used by recusive function calls.

    Returns
    ----------
      tvfile.ShowInfo or None
        If no show id could be found this returns None, otherwise
        it returns a tvfile.ShowInfo object containing show name
        and show id.
    """
    showInfo = tvfile.ShowInfo()

    if origStringSearch is None:
      goodlogging.Log.Info("RENAMER", "Looking up show ID for: {0}".format(stringSearch))
      origStringSearch = stringSearch

    goodlogging.Log.IncreaseIndent()

    showInfo.showID = self._db.SearchFileNameTable(stringSearch)

    if showInfo.showID is None:
      goodlogging.Log.Info("RENAMER", "No show ID match found for '{0}' in database".format(stringSearch))
      showNameList = self._guide.ShowNameLookUp(stringSearch)

      if self._skipUserInput is True:
        if len(showNameList) == 1:
          showName = showNameList[0]
          goodlogging.Log.Info("RENAMER", "Automatic selection of showname: {0}".format(showName))
        else:
          showName = None
          goodlogging.Log.Info("RENAMER", "Show skipped - could not make automatic selection of showname")
      else:
        showName = util.UserAcceptance(showNameList)

      if showName in showNameList:
        libEntry = self._db.SearchTVLibrary(showName = showName)

        if libEntry is None:
          if self._skipUserInput is True:
            response = 'y'
          else:
            goodlogging.Log.Info("RENAMER", "No show by this name found in TV library database. Is this a new show for the database?")
            response = goodlogging.Log.Input("RENAMER", "Enter 'y' (yes), 'n' (no) or 'ls' (list existing shows): ")
            response = util.ValidUserResponse(response, ('y', 'n', 'ls'))

            if response.lower() == 'ls':
              dbLibList = self._db.SearchTVLibrary()
              if dbLibList is None:
                goodlogging.Log.Info("RENAMER", "TV library is empty")
                response = 'y'
              else:
                dbShowNameList = [i[1] for i in dbLibList]
                dbShowNameStr = ', '.join(dbShowNameList)
                goodlogging.Log.Info("RENAMER", "Existing shows in database are: {0}".format(dbShowNameStr))
                response = goodlogging.Log.Input("RENAMER", "Is this a new show? [y/n]: ")
                response = util.ValidUserResponse(response, ('y', 'n'))
          if response.lower() == 'y':
            showInfo.showID = self._db.AddShowToTVLibrary(showName)
            showInfo.showName = showName
          else:
            try:
              dbShowNameList
            except NameError:
              dbLibList = self._db.SearchTVLibrary()
              if dbLibList is None:
                goodlogging.Log.Info("RENAMER", "No show ID found - TV library is empty")
                return None
              dbShowNameList = [i[1] for i in dbLibList]

            while showInfo.showID is None:
              matchShowList = util.GetBestMatch(showName, dbShowNameList)
              showName = util.UserAcceptance(matchShowList)
              if showName is None:
                goodlogging.Log.Info("RENAMER", "No show ID found - could not match to existing show")
                return None
              elif showName in matchShowList:
                showInfo.showID = self._db.SearchTVLibrary(showName = showName)[0][0]
                showInfo.showName = showName

        else:
          showInfo.showID = libEntry[0][0]

        self._db.AddToFileNameTable(origStringSearch, showInfo.showID)

        goodlogging.Log.DecreaseIndent()
        return showInfo
      elif showName is None:
        goodlogging.Log.DecreaseIndent()
        return None
      else:
        goodlogging.Log.DecreaseIndent()
        return self._GetShowID(showName, origStringSearch)
    else:
      goodlogging.Log.Info("RENAMER", "Match found: show ID = {0}".format(showInfo.showID))
      if origStringSearch != stringSearch:
        self._db.AddToFileNameTable(origStringSearch, showInfo.showID)
      goodlogging.Log.DecreaseIndent()
      return showInfo