Пример #1
0
 def compareDetails( self, currentShow, newShow ) :
     """
     Compares two Shows for differences.
     
     :param currentShow: Old show
     :type currentShow: :class:`api.dbapi.Show`
     :param newShow: New show
     :type newShow: :class:`api.dbapi.Show`
     :returns: Updated show.
     :rtype: :class:`api.dbapi.Show`
     """
     editedShow = Show( currentShow.name, currentShow.duration, currentShow.backend, currentShow.url )
     
     for newSeason in newShow.seasons :
         
         currentSeason = currentShow.getSeason( newSeason )
         
         if currentSeason == None :
             editedShow.addSeason( newSeason )
         
         else :
             editedShow.addSeason( self.compareSeasons( currentSeason, newSeason ) )
             
     return editedShow