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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [cdb98c5876]

Overview
Comment:Preliminary fix for recent action.play/record hook changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cdb98c5876a5b9c2e8dcade020d3aa2c60883b68
User & Date: mario on 2015-11-09 00:10:15
Other Links: manifest | tags
Context
2015-11-09
21:37
Permit "Any" or "All" in time specifications (for all weekdays). check-in: 6402b2ce1d user: mario tags: trunk
00:10
Preliminary fix for recent action.play/record hook changes. check-in: cdb98c5876 user: mario tags: trunk
2015-11-08
14:01
Python3 fixes (use `log.XYZ` instead of `print` statement). check-in: 00df54ba31 user: mario tags: trunk
Changes

Modified channels/timer.py from [9ee919d14b] to [6a46d248b9].

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
# 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.
#







|







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.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
            return int(duration) # in minutes
        except:
            return 0   # no limit
        
    # action wrapper
    def play(self, row, *args, **kwargs):
        action.play(
            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)
        
        # 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"],
            audioformat = row.get("format","audio/mpeg"), 
            listformat = row.get("listformat","href"),
            append = append,
        )
    
    def test(self, row, *args, **kwargs):
        log.TEST("KRONOS", row)









|

|















|

|
|






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(
            row = row,
            audioformat = row.get("format","audio/mpeg"), 
            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(
            row = row,
            audioformat = row.get("format","audio/mpeg"), 
            source = row.get("listformat","href")
            #append = append,
        )
    
    def test(self, row, *args, **kwargs):
        log.TEST("KRONOS", row)