I can't figure out why my playlist is only playing the first three
songs. I have tried switching the order of the songs around to see if
there was a problem with certain tracks, but I think all the files are
fine. Started liquidsoap in verbose mode (-v) didn't see anything
helpful.

Here is my basic playlist setup:

# The file source
backup_playlist =
playlist(reload=600,"/var/www/datafruits-transmitter/shared/datafruits_playlist.m3u",conservative=true,mode="normal")
output.dummy(fallible=true,backup_playlist)


then later on I have a fallback:
source = fallback(track_sensitive=false,
                  [live_dj,backup_playlist,on_fail])


Of course my entire script is much longer, I'll paste the entire thing here.


#!/usr/local/bin/liquidsoap

set("log.file",true)
set("log.file.path","/usr/local/var/log/liquidsoap/liquidsoap.log")
set("log.stdout",false)
set("log.level",3)

set("server.telnet",true)
set("server.socket",true)
set("server.socket.path","/tmp/liquidsoap.sock")

set("harbor.bind_addr","0.0.0.0")

# refs
title_prefix = ref ""

#functions

#auth function
def dj_auth(user,password) =
  #get the output of the php script
  ret = get_process_lines("bundle exec
/var/www/datafruits-transmitter/current/dj_auth.rb #{user}
#{password}")
  #ret has now the value of the live client (dj1,dj2, or djx), or
"ERROR"/"unknown"
  ret = list.hd(ret)
  #return true to let the client transmit data, or false to tell
harbor to decline
  if ret == "true" then
    title_prefix := "LIVE NOW ♫✩ -- #{user} ✩♪"
    true
  else
    false
  end
end

def on_disconnect() =
  title_prefix := ""
end

def pub_metadata(m) =
  log("metadata changed: #{m}")
  title = m["title"]
  log("title: #{title}")
  result = get_process_lines("bundle exec
/var/www/datafruits-transmitter/current/pub_metadata.rb
\"#{quote(title)}\"")
  log("pub_metadata: #{result}")
end

# The file source
backup_playlist =
playlist(reload=600,"/var/www/datafruits-transmitter/shared/datafruits_playlist.m3u",conservative=true,mode="normal")
output.dummy(fallible=true,backup_playlist)
live_dj = 
input.harbor("datafruits",port=9000,auth=dj_auth,on_disconnect=on_disconnect)

def new_meta(m) =
  title = m["title"]
  [("title","#{!title_prefix} -- #{title}")]
end
live_dj = map_metadata(new_meta, live_dj)
on_fail = single("/home/freedrull/datafruitsdotfm_processed.wav")

source = fallback(track_sensitive=false,
                  [live_dj,backup_playlist,on_fail])
source = on_metadata(pub_metadata, source)

# flows
source = register_flow(
  radio="datafruits.fm",
  website="http://radio.datafruits.fm/";,
  description="forward-thinking electronic sounds",
  genre="electronic",
  user="foo",
  password="bar",
  streams=[("mp3/128k","http://radio.datafruits.fm:8000/datafruits.mp3";),
           ("ogg", "http://radio.datafruits.fm:8000/datafruits.ogg";)],
  source)

output.file(%mp3, "/mnt/wat/dump-datafruits-%d-%m-%Y-%H:%M:%S.mp3",
live_dj,fallible=true)
# We output the stream to an icecast
# server, in ogg/vorbis format.
output.icecast(%vorbis,id="icecast",
               mount="datafruits.ogg",
               host="localhost", password="2datafr00ts",
               icy_metadata="true",description="datafruits.fm",
               url="http://datafruits.fm";,
               source)
output.icecast(%mp3,id="icecast",
               mount="datafruits.mp3",
               host="localhost", password="2datafr00ts",
               icy_metadata="true",description="datafruits.fm",
               url="http://datafruits.fm";,
               source)


-- 
-Tony Miller
github.com/mcfiredrill
@freedrull
freedrool.us

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to