132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
-
+
|
activity, action_method = "record", self.record
else:
activity, action_method = "play", self.play
# add
task = self.sched.add_daytime_task(action_method, activity, days, None, time, kronos.method.threaded, [row], {})
#log.QUEUE( act, self.sched, (action_method, act, days, None, time, kronos.method.threaded, [row], {}), task.get_schedule_time(True) )
log.QUEUE( activity, self.sched, (action_method, activity, days, None, time, kronos.method.threaded, [row], {}), task.get_schedule_time(True) )
# converts Mon,Tue,... into numberics 1-7
def days(self, s):
weekdays = ["su", "mo", "tu", "we", "th", "fr", "sa", "su"]
r = []
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
-
+
|
url = row["url"],
audioformat = row.get("format","audio/mpeg"),
listformat = row.get("listformat","href"),
)
# action wrapper
def record(self, row, *args, **kwargs):
#log.TIMER("TIMED RECORD", *args)
log.TIMER("TIMED RECORD", *args)
# extra params
duration = self.duration(row.get(self.timefield))
if duration:
append = " -a %S.%d.%q -l "+str(duration*60) # make streamripper record a whole broadcast
else:
append = ""
|