def logDownload(episode, filename, new_ep_quality, release_group=None, version=(-1)):
 showid = int(episode.show.indexerid)
 season = int(episode.season)
 epNum = int(episode.episode)
 quality = new_ep_quality
 if release_group:
  provider = release_group
 else:
  provider = (-1)
 action = episode.status
 _logHistoryItem(action, showid, season, epNum, quality, filename, provider, version)

def logDownload ( episode , filename , new_ep_quality , release_group = None , version = ( - 1 ) ) : showid = int ( episode . show . indexerid ) season = int ( episode . season ) epNum = int ( episode . episode ) quality = new_ep_quality if release_group : provider = release_group else : provider = ( - 1 ) action = episode . status _logHistoryItem ( action , showid , season , epNum , quality , filename , provider , version )
log history of download .