Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ branch:  streamtuner2


Diff

Differences From Artifact [9ee919d14b]:

To Artifact [6a46d248b9]:


1
2
3
4
5
6
7
8

9
10
11
12
13
14
15
1
2
3
4
5
6
7

8
9
10
11
12
13
14
15







-
+






#
# api: streamtuner2
# title: Recording timer
# description: Schedules play/record events for bookmarked radio stations.
# type: feature
# category: hook
# depends: kronos
# version: 0.6
# version: 0.7
# config: -
# priority: optional
# support: unsupported
#
# Provides an internal timer, to configure recording and playback times/intervals
# for stations. It accepts a natural language time string when registering a stream.
#
165
166
167
168
169
170
171
172

173
174

175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190

191
192
193


194
195
196
197
198
199
165
166
167
168
169
170
171

172
173

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189

190
191


192
193
194
195
196
197
198
199







-
+

-
+















-
+

-
-
+
+





            return int(duration) # in minutes
        except:
            return 0   # no limit
        
    # action wrapper
    def play(self, row, *args, **kwargs):
        action.play(
            url = row["url"],
            row = row,
            audioformat = row.get("format","audio/mpeg"), 
            listformat = row.get("listformat","href"),
            source = row.get("listformat","href")
        )

    # action wrapper
    def record(self, row, *args, **kwargs):
        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 = ""

        # start recording
        action.record(
            url = row["url"],
            row = row,
            audioformat = row.get("format","audio/mpeg"), 
            listformat = row.get("listformat","href"),
            append = append,
            source = row.get("listformat","href")
            #append = append,
        )
    
    def test(self, row, *args, **kwargs):
        log.TEST("KRONOS", row)