def logSnatch(searchResult):
 for curEpObj in searchResult.episodes:
  showid = int(curEpObj.show.indexerid)
  season = int(curEpObj.season)
  episode = int(curEpObj.episode)
  quality = searchResult.quality
  version = searchResult.version
  providerClass = searchResult.provider
  if (providerClass is not None):
   provider = providerClass.name
  else:
   provider = 'unknown'
  action = Quality.compositeStatus(SNATCHED, searchResult.quality)
  resource = searchResult.name
  _logHistoryItem(action, showid, season, episode, quality, resource, provider, version)

def logSnatch ( searchResult ) : for curEpObj in searchResult . episodes : showid = int ( curEpObj . show . indexerid ) season = int ( curEpObj . season ) episode = int ( curEpObj . episode ) quality = searchResult . quality version = searchResult . version providerClass = searchResult . provider if ( providerClass is not None ) : provider = providerClass . name else : provider = 'unknown' action = Quality . compositeStatus ( SNATCHED , searchResult . quality ) resource = searchResult . name _logHistoryItem ( action , showid , season , episode , quality , resource , provider , version )
log history of snatch .