|
Hi folks, Here's what happened: I really like "Who's Line is it Anyway", and set it up as one of my favorites, not realizing that the Family Channel show this 3-4 times a night. Also, I set "Mythbusters" to record on Discovery Channel, and they show it multiple times as well. I ended up with duplicates in my freevo record directory of the same show, same plot, but different air times. I thought I could (easily) modify recordserver.py and have it check to see if there was a recording of that show with that plot. If such a beast existed, then don't record. Here's what I was trying. The help I need is understanding how to test this and how to decode fxd files. BTW, I have RTFM (as much as I could find), but it was not intuitively obvious for one starting to learn the Freevo system. Also, how do you test and debug recordserver.py? Right now, I have it running as a daemon from my init.d script. I tried starting it with the -trace command, thinking I would get the outputs of my print commands below, but no such luck. ============================================== def updateFavoritesSchedule(self): # TODO: do not re-add a prog to record if we have # previously decided not to record it. (snip) # Then remove all scheduled favorites in that timeframe to # make up for schedule changes. progs = scheduledRecordings.getProgramList() for prog in progs.values(): # try: # favorite = prog.isFavorite # except: # favorite = FALSE # if prog.start <= last and favorite: (isFav, favorite) = self.isProgAFavorite(prog, favs) if prog.start <= last and isFav: self.removeScheduledRecording(prog) if not config.ALLOW_DUPLICATE_PLOTS and find_dup_fxd(prog): self.removeScheduledRecording(prog) for ch in guide.chan_list: for prog in ch.programs: (isFav, favorite) = self.isProgAFavorite(prog, favs) if isFav: prog.isFavorite = favorite self.scheduleRecording(prog) return (TRUE, 'favorites schedule updated') ============================================== Here's my find_dup_fxd(prog) routine. As you can see, I was trying to print out the items so I could get a feeling for how util.fxdparser() works. How can I def find_dup_fxd(self, rec_prog): files = [f for f in os.listdir(config.TV_RECORD_DIR) if f.endswith(".fxd")] for fil in files: parser = util.fxdparser.FXD(fil) parser.parse() items = parser.getattr(None, 'items') #fxd.info['plot'] = fxd.str2XML(rec_prog.desc) <<<----note: here I want to insert a test comparing rec_prog vs. current file and return 1 if same print items return 0 ============================================== Mike |
