Discussions
Activity
Sign In
How it works
Airtime Support
switch within input.http
Vote Up
0
Vote Down
Nicolaj
March 2015
Posts: 1
Member
Hello
i'm trying to switch the input by time with the following script:
SourceA = "
http://www.surfmusik.de/m3u/nrj-fitness,14926.m3u
"
SourceB = "
http://listen.radionomy.com/gong.m3u
"
Webradio = input.http(
switch([
({ 6h-9h }, SourceA),
({ 9h-12h }, SourceB),
({ 12h-14h }, SourceA),
({ 14h-18h }, SourceB),
({ 18h-20h }, SourceA),
({ 20h-22h }, SourceB),
({ 22h-6h }, SourceA)
])
)
but getting an error on the syntax:
At line 21 char 9 - line 29 char 2:
this value has type
[(_*string)]
but it should be a subtype of
[(_*source(_))]
Is it possible to do something like this?
Thanks and best regards
Nicolaj
1 Comment
sorted by
Votes
Date Added
Vote Up
0
Vote Down
Krypton Radio
March 2015
Posts: 78
Member
Yes.
All you have to do is add square brackets:
SourceA = "
http://www.surfmusik.de/m3u/nrj-fitness,14926.m3u
"
SourceB = "
http://listen.radionomy.com/gong.m3u
"
Webradio = input.http(
switch([
({ 6h-9h }, [SourceA]),
({ 9h-12h }, [SourceB]),
({ 12h-14h }, [SourceA]),
({ 14h-18h }, [SourceB]),
({ 18h-20h }, [SourceA]),
({ 20h-22h }, [SourceB]),
({ 22h-6h }, [SourceA])
])
)
Add a Comment
Start a New Discussion
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
8,397
Sourcefabric
↳
Announcements
25
Newscoop
↳
Newscoop Support
2,189
↳
Newscoop Development
722
↳
Newscoop Security
13
↳
Newscoop Documentation
17
↳
Newscoop Themes
69
Airtime
↳
Airtime Support
3,139
↳
Airtime Development
1,286
↳
Airtime Français
146
↳
Airtime Documentation
14
↳
Airtime Hacks
102
↳
Promote your station!
37
↳
Airtime Security
11
Booktype
↳
Booktype Support
277
↳
Booktype Development
55
↳
Booktype Documentation
7
Superdesk
↳
Superdesk Development
264
↳
Web Publisher
21
Poll
No poll attached to this discussion.
Top Posters
Albert FR
1978
Martin Konecny
1860
Andrey Podshivalov
1526
Voisses Tech
1423
John Chewter
899
Daniel James
844
Roger Wilco
784
hoerich
627
Paul Baranowski
389
Cliff Wang
339