def remove_series(name, forget=False):
 downloaded_releases = []
 with Session() as session:
  series = session.query(Series).filter((Series.name == name)).all()
  if series:
   for s in series:
    if forget:
     for episode in s.episodes:
      for release in episode.downloaded_releases:
       downloaded_releases.append(release.title)
    session.delete(s)
   session.commit()
   log.debug(u'Removed series %s from database.', name)
  else:
   raise ValueError((u'Unknown series %s' % name))
 for downloaded_release in downloaded_releases:
  fire_event(u'forget', downloaded_release)

def remove_series ( name , forget = False ) : downloaded_releases = [ ] with Session ( ) as session : series = session . query ( Series ) . filter ( ( Series . name == name ) ) . all ( ) if series : for s in series : if forget : for episode in s . episodes : for release in episode . downloaded_releases : downloaded_releases . append ( release . title ) session . delete ( s ) session . commit ( ) log . debug ( u'Removed series %s from database.' , name ) else : raise ValueError ( ( u'Unknown series %s' % name ) ) for downloaded_release in downloaded_releases : fire_event ( u'forget' , downloaded_release )
remove a whole series name from database .