'Saves this episode to the database if any of its data has been changed since the last save.
forceSave: If True it will save to the database even if no data has been changed since the
last save (aka if the record is not dirty).'

def saveToDB(self, forceSave=False):

    if ((not self.dirty) and (not forceSave)):
        return
    sickrage.srCore.srLogger.debug((u'%i:    Saving    episode    to    database:    %s' % (self.show.indexerid, self.name)))
    tv_episode = {u'_t': u'tv_episodes', u'showid': self.show.indexerid, u'season': self.season, u'episode': self.episode, u'scene_season': self.scene_season, u'scene_episode': self.scene_episode, u'indexerid': self.indexerid, u'indexer': self.indexer, u'name': self.name, u'description': self.description, u'subtitles': u','.join(self.subtitles), u'subtitles_searchcount': self.subtitles_searchcount, u'subtitles_lastsearch': self.subtitles_lastsearch, u'airdate': self.airdate.toordinal(), u'hasnfo': self.hasnfo, u'hastbn': self.hastbn, u'status': self.status, u'location': self.location, u'file_size': self.file_size, u'release_name': self.release_name, u'is_proper': self.is_proper, u'absolute_number': self.absolute_number, u'scene_absolute_number': self.scene_absolute_number, u'version': self.version, u'release_group': self.release_group}
    try:
        dbData = [x[u'doc'] for x in sickrage.srCore.mainDB.db.get_many(u'tv_episodes', self.show.indexerid, with_doc=True) if (x[u'doc'][u'indexerid'] == self.indexerid)][0]
        dbData.update(tv_episode)
        sickrage.srCore.mainDB.db.update(dbData)
    except:
        sickrage.srCore.mainDB.db.insert(tv_episode)
