Replies: 1 comment 3 replies
-
Hi! Thank you for this feedback, this is really appreciated and exactly what we needed. Feel free to be yourself and be as verbose as you want! I'm naturally a little more succinct so...:
For 4., basically, one of your source has an extra Another way to work around is to subtype all the sources to just sources without methods, which is all that the switch really care about: special = switch (id="specswitch", [
({1w and 05h-00h}, (tracker:source)), # MOD MONDAYS!
({3w and 17h-19h}, (comedy:source)), # Do the Comedy Mix on Wednesdays
({5w and 18h-19h}, (delay(7200.0, longform):source)) # Play a Longform Mix on Friday (don't re-fire within 2 hours)
]) Hope this helps. Please, keep us posted about 3., and wether it is a bug or not. Thanks! |
Beta Was this translation helpful? Give feedback.
-
(Sorry this is so long. I am a very verbose person. It's just the way I am)
i stepped up to 2.0.0-rc1 to try to flush out a problem in 1.4.x. The problem is solved in 2.0.0-rc1 but I found a few other things that struck me as odd while getting to know the new version. Rather than spam a bunch of Issues that might not actually be issues, I thought I'd open it up for discussion.
Default Playlist IDs
In 1.3.x and 1.4.x, if you didn't explicitly specify an id for a playlist, it would get one based on the directory or file name. playlist("/mnt/media/<...>/comedy") would have the id "comedy". In 2.0.0.-rc1 it appears if you don't assign an id to a playlist it gets a generic name of "playlist_#" with the number increasing with each playlist. This is a bit confusing in the logs and when trying to send commands to the playlists via the telnet interface.
This isn't anything that's broken, just cosmetic convenience. Of course I can add id arguments to each playlist statement and maybe that's the correct answer, But I liked the convenience of the automatic naming, since my directories and playlist files are usually named for what they are ("comedy", "morning", "evening", "longform", etc).
(I used to put the .m3u extension on my list files but that named the playlist "morning(dot)m3u" which was super-cumbersome to type so I got rid of the extensions)
Playlist "next" function in telnet interface
I went to issue a playlist.next command in the telnet interface and was surprised to get "OK" in return. And more surprised when my playlist advanced to the next item. The log said that "next" is deprecated and I should use "skip" instead, which is fair. Except that in 1.4.x (and I think 1.3.x) "next" didn't move the playlist forward, it listed the next 12 items in the playlist queue with indications of which items were queued or currently playing.
I like this function, especially on my playlists that only play at certain times. I can peek at what's coming up before it is put in the stream (and skip it if I'm not feeling it). I admit that calling it "next" is confusing and seems like it should move the playlist to the next item. Could the queue printout function be returned and maybe named something more appropriate? "upnext"? "queue"?
Fallback (I think?) plays an extra item before switching when source becomes available
This was present in 1.4.x as well but I'm pretty sure not in 1.3.x. It seems to be in the fallback function, but maybe it's somewhere else and manifests itself at the fallback statement.
I have a fallback statement:
where "upnext" is a request.queue, "album" is a playlist, "special" is a switch statement and "music" is another switch.
The idea is that pushing something into the "upnext" queue will cause it to be the next thing played. However, once there is an item in the "upnext" queue, the current item finishes and another is played from that source before fallback goes to the "upnext" source. Doing a "request.trace" on the RID of the upnext queue item shows it isn't even resolved until the "extra" item starts playing.
The same behavior is observed with the "album" playlist: it starts with an empty file and is watched. Once I copy a list into the file, the current item and one more will play before fallback kicks over to "album". I haven't paid close enough attention but I would bet the same thing happens when one of the "special" events becomes available.
I can live with this one... I just know that "upnext" or "album" won't start until after the next song. But it seems like where timing is a factor (say, a top-of-the-hour ID on a radio station) the ID might be switched in to play at the first available spot after the top of the hour, but if it doesn't play until after another song the ID could be delayed for a bit.
Bonus: Why does order of Switch items matter?
This isn't a bug or a problem (as least as far as I know?), but I ran into it when converting my script to 2.0.0-rc1 and it confused me. My "special events" switch statement was the following in 1.3.x and 1.4.x:
where "tracker" and "longform" are playlists and "comedy" is a Random function between the "music" switch and the "humor" playlist. Problem was, that statement in 2.0.0.-rc1 would throw the following error:
I poked and prodded at it and eventually traced it to the "comedy" variable (subbing in "humor" or "music" would not throw the error) but I had no idea what the error was trying to tell me. Out of desperation, I decided to shake up the order of the statements in the switch statement:
(swapping the last two lines) and it no longer throws the error. But I don't understand why? Anyone have any ideas?
Thanks for reading this far. Any or all or none of these might be things to change in 2.0.0-rc1 or beyond. They're just things that struck me right off the bat and I wanted to share and get others' insights about them. I'm certainly a newb at Liquidsoap and Ocaml is completely new to me too, so I'm positive there's a lot I could learn. ^_^
Beta Was this translation helpful? Give feedback.
All reactions