Author: duncan
Date: Sat May 26 07:54:51 2007
New Revision: 9607

Modified:
   branches/rel-1/freevo/ChangeLog
   branches/rel-1/freevo/freevo_config.py
   branches/rel-1/freevo/local_conf.py.example
   branches/rel-1/freevo/src/helpers/recordserver.py

Log:
[ 1725823 ] Progams considered a Favorite if within a margin or error
Patch from Adam Charrett applied


Modified: branches/rel-1/freevo/ChangeLog
==============================================================================
--- branches/rel-1/freevo/ChangeLog     (original)
+++ branches/rel-1/freevo/ChangeLog     Sat May 26 07:54:51 2007
@@ -23,6 +23,7 @@
  * Updated image viewer to exclude certain types of images be a regex 
(F#1719613)
  * Updated mplayer to allow multiple crop points (F#1712397)
  * Updated mplayer to allow previous channel selection (F#1720667)
+ * Updated recordserver to allow a tolerance for a favourite (F#1725823)
  * Updated vlc plug-in for better integration in freevo (F#1721808)
  * Fixed alsamixer choose mute control (B#1717659)
  * Fixed CD burn plug-in's incorrect internationalization strings (B#1722295)

Modified: branches/rel-1/freevo/freevo_config.py
==============================================================================
--- branches/rel-1/freevo/freevo_config.py      (original)
+++ branches/rel-1/freevo/freevo_config.py      Sat May 26 07:54:51 2007
@@ -272,6 +272,7 @@
      Added MPLAYER_OLDTVCHANNELCHANGE to allow the PREV_CH button to swap to 
previous channel
      Added RSS_DOWNLOAD for a place to save downloaded data
      Added IMAGE_EXCLUDE as a regular expression to exclude images such as 
thumbnails
+     Added TV_RECORD_FAVORITE_MARGIN to allow favourites to be added to the 
schedule within a tolerance value
      ''' ),
 ]
 
@@ -1588,6 +1589,16 @@
 TV_RECORD_PADDING_PRE = 0
 TV_RECORD_PADDING_POST = 0
 
+# Number of minutes before or after the start time of a favorite where
+# a program matching the name, day of week etc should still be considered a
+# favorite. For example a favorite has a start time of 21.00, but the program
+# has been brought forward by the broadcaster by 10 minutes to 20.50, with
+# a margin of less than 10 this program will not be recorded as the start time 
+# is outside the margin. But if the margin is set at 10 minutes or greater this
+# program will be considered a favorite and recorded. Probably about 45 
minutes 
+# is the best bet, better a false positive than a false negative.
+TV_RECORD_FAVORITE_MARGIN = 45
+
 if os.uname()[0] == 'FreeBSD':
     # FreeBSD's bsdbt848 TV driver doesn't support audio settings?
     VCR_AUDIO = ''

Modified: branches/rel-1/freevo/local_conf.py.example
==============================================================================
--- branches/rel-1/freevo/local_conf.py.example (original)
+++ branches/rel-1/freevo/local_conf.py.example Sat May 26 07:54:51 2007
@@ -1213,13 +1213,17 @@
 
 # TV_RECORDFILE_MASK = '%%m-%%d %%H:%%M %(progname)s - %(title)s'
 
-
-# if using the persitant recordserver
+# If using the persistent recordserver
 # TV_RECORD_SCHEDULE = '%s/record_schedule.xml' % FREEVO_CACHEDIR
 
 # RECORDSERVER_IP = 'localhost'
 # RECORDSERVER_PORT = 18001
 
+# If the recordserver runs as root, set the uid to the given one
+# after startup. The gui must also match one of the users group ids
+# RECORDSERVER_UID = 0
+# RECORDSERVER_UID = 0
+
 # Remove old recordings if GB free is less than specified value
 # RECORDSERVER_CLEANUP_THRESHOLD = 0
 
@@ -1227,7 +1231,18 @@
 # and stop X minutes after scheduled - default to zero minutes.
 # This must be a value in seconds although at the moment only has
 # the percision of one minute.
-# TV_RECORD_PADDING = 0 * 60
+# TV_RECORD_PADDING_PRE = 0
+# TV_RECORD_PADDING_POST = 0
+
+# Number of minutes before or after the start time of a favorite where
+# a program matching the name, day of week etc should still be considered a
+# favorite. For example a favorite has a start time of 21.00, but the program
+# has been brought forward by the broadcaster by 10 minutes to 20.50, with
+# a margin of less than 10 this program will not be recorded as the start time 
+# is outside the margin. But if the margin is set at 10 minutes or greater this
+# program will be considered a favorite and recorded. Probably about 45 
minutes 
+# is the best bet, better a false positive than a false negative.
+# TV_RECORD_FAVORITE_MARGIN = 45
 
 # VCR_AUDIO = (':adevice=%s' % AUDIO_DEVICE +
 #              ':audiorate=32000' +         # 44100 for better sound

Modified: branches/rel-1/freevo/src/helpers/recordserver.py
==============================================================================
--- branches/rel-1/freevo/src/helpers/recordserver.py   (original)
+++ branches/rel-1/freevo/src/helpers/recordserver.py   Sat May 26 07:54:51 2007
@@ -1064,7 +1064,6 @@
 
         lt = time.localtime(prog.start)
         dow = '%s' % lt[6]
-        mod = '%s' % ((lt[3]*60)+(lt[4] / 30 * 30))
         mod = '%s' % ((lt[3]*60)+lt[4])
 
         for fav in favs.values():
@@ -1072,8 +1071,8 @@
                 if fav.channel == 
tv_util.get_chan_displayname(prog.channel_id) \
                 or fav.channel == 'ANY':
                     if Unicode(fav.dow) == Unicode(dow) or Unicode(fav.dow) == 
u'ANY':
-                        if Unicode(fav.mod) == Unicode(mod) \
-                        or Unicode(fav.mod) == u'ANY':
+                        if Unicode(fav.mod) == u'ANY' \
+                        or abs(int(fav.mod) - int(mod)) <= 
config.TV_RECORD_FAVORITE_MARGIN:
                             return (TRUE, fav.name)
 
         # if we get this far prog is not a favorite

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to