Update of /cvsroot/freevo/freevo/src/helpers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7195

Modified Files:
        recordserver.py 
Log Message:
Make checkToRecord() void, start the recording plugin from there, call it
from multiple places.

Also make movie search work again, using ratings instead of the date property
which totally blew up using zap2it datadirect (everything had date).  Right
now we just look for 'MPAA' rating for movies but if anyone knows of other
movies only rating systems we can add please speak up.



Index: recordserver.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/helpers/recordserver.py,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** recordserver.py     20 Jun 2004 21:51:38 -0000      1.43
--- recordserver.py     22 Jun 2004 01:15:15 -0000      1.44
***************
*** 7,10 ****
--- 7,19 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.44  2004/06/22 01:15:15  rshortt
+ # Make checkToRecord() void, start the recording plugin from there, call it
+ # from multiple places.
+ #
+ # Also make movie search work again, using ratings instead of the date property
+ # which totally blew up using zap2it datadirect (everything had date).  Right
+ # now we just look for 'MPAA' rating for movies but if anyone knows of other
+ # movies only rating systems we can add please speak up.
+ #
  # Revision 1.43  2004/06/20 21:51:38  dischi
  # do call minutecheck, check yourself
***************
*** 187,195 ****
  
          # check, maybe we need to start right now
!         rec_prog = self.checkToRecord()
!         if rec_prog:
!             _debug_('start recording')
!             self.record_app = plugin.getbyname('RECORD')
!             self.record_app.Record(rec_prog)
          return (TRUE, 'recording scheduled')
      
--- 196,201 ----
  
          # check, maybe we need to start right now
!         self.checkToRecord()
! 
          return (TRUE, 'recording scheduled')
      
***************
*** 242,249 ****
          for ch in guide.chan_list:
              if chan == ch.id:
!                 _debug_('CHANNEL MATCH')
                  for prog in ch.programs:
                      if start == '%s' % prog.start:
!                         _debug_('PROGRAM MATCH')
                          return (TRUE, prog.decode())
  
--- 248,255 ----
          for ch in guide.chan_list:
              if chan == ch.id:
!                 _debug_('CHANNEL MATCH: %s' % ch.id)
                  for prog in ch.programs:
                      if start == '%s' % prog.start:
!                         _debug_('PROGRAM MATCH: %s' % prog.decode().title)
                          return (TRUE, prog.decode())
  
***************
*** 257,260 ****
--- 263,267 ----
      
          matches = []
+         max_results = 500
  
          if not find and not movies_only:
***************
*** 274,287 ****
                  if not find or regex.match(prog.title) or regex.match(prog.desc) \
                     or regex.match(prog.sub_title):
-                     _debug_('PROGRAM MATCH: %s' % prog.decode())
                      if movies_only:
!                         if hasattr(prog, 'date') and prog.date:
                              matches.append(prog.decode())
                      else:
                          # We should never get here if not find and not 
                          # movies_only.
                          matches.append(prog.decode())
  
!         _debug_('return: %s' % str(matches))
  
          if matches:
--- 281,299 ----
                  if not find or regex.match(prog.title) or regex.match(prog.desc) \
                     or regex.match(prog.sub_title):
                      if movies_only:
!                         # We can do better here than just look for the MPAA 
!                         # rating.  Suggestions are welcome.
!                         if 'MPAA' in prog.decode().getattr('ratings').keys():
                              matches.append(prog.decode())
+                             _debug_('PROGRAM MATCH: %s' % prog.decode())
                      else:
                          # We should never get here if not find and not 
                          # movies_only.
                          matches.append(prog.decode())
+                         _debug_('PROGRAM MATCH: %s' % prog.decode())
+                 if len(matches) >= max_results:
+                     break
  
!         _debug_('Found %d matches.' % len(matches))
  
          if matches:
***************
*** 337,341 ****
                  duration = int((prog.stop + config.TV_RECORD_PADDING ) - now - 10)
                  if duration < 10:
!                     return FALSE
  
                  if currently_recording:
--- 349,353 ----
                  duration = int((prog.stop + config.TV_RECORD_PADDING ) - now - 10)
                  if duration < 10:
!                     return 
  
                  if currently_recording:
***************
*** 390,396 ****
              sr.setProgramList(progs)
              self.saveScheduledRecordings(sr)
-             return rec_prog
  
!         return FALSE
  
  
--- 402,410 ----
              sr.setProgramList(progs)
              self.saveScheduledRecordings(sr)
  
!         if rec_prog:
!             _debug_('start recording')
!             self.record_app = plugin.getbyname('RECORD')
!             self.record_app.Record(rec_prog)
  
  
***************
*** 798,807 ****
          else:
              reactor.callLater(60, self.minuteCheck)
!         rec_prog = self.checkToRecord()
!         if rec_prog:
!             _debug_('start recording')
!             self.record_app = plugin.getbyname('RECORD')
!             self.record_app.Record(rec_prog)
!             
  
      def eventNotice(self):
--- 812,818 ----
          else:
              reactor.callLater(60, self.minuteCheck)
! 
!         self.checkToRecord()
! 
  
      def eventNotice(self):



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to