Pypo fixes and improvements
General: * Moved pypo author info into one file * Added two database columns in schedule table: "schedule_group_played" and "media_item_played". API clients: * Created get_liquidsoap_data() function which allows you to give arbitrary data to liquidsoap. * Added documentation * Renamed functions to make it more obvious what is happening pypo_cli: * Got rid of more constants that were not needed * Created function set_export_source() to reduce code repetition * Separated the downloading of the schedule from tracking what has been played. The tracking info is now kept in a separate file. This fixes the major bug that the playlist keeps restarting for the first minute of playback. * converted more print statements to debug statements pypoTester: * Now uses samples from the audio_samples directory, and schedules two audio clips back-to-back.
This commit is contained in:
parent
a138424451
commit
3613812012
20 changed files with 699 additions and 543 deletions
2
3rd_party/pypo/scripts/cue_file.py
vendored
2
3rd_party/pypo/scripts/cue_file.py
vendored
|
@ -1,8 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# author Jonas Ohrstrom <jonas@digris.ch>
|
||||
|
||||
|
||||
"""
|
||||
cue script that gets called by liquidsoap if a file in the playlist
|
||||
|
|
|
@ -6,7 +6,11 @@ playlist_id = ref '0'
|
|||
user_id = ref '0'
|
||||
transmission_id = ref '0'
|
||||
playlist_type = ref '0'
|
||||
pypo_data = ref '0'
|
||||
|
||||
def set_pypo_data(s)
|
||||
pypo_data := s
|
||||
end
|
||||
|
||||
def set_user_id(s)
|
||||
user_id := s
|
||||
|
@ -29,4 +33,5 @@ end
|
|||
server.register(namespace="vars", "user_id", fun (s) -> begin set_user_id(s) "Done!" end)
|
||||
server.register(namespace="vars", "playlist_id", fun (s) -> begin set_playlist_id(s) "Done!" end)
|
||||
server.register(namespace="vars", "transmission_id", fun (s) -> begin set_transmission_id(s) "Done!" end)
|
||||
server.register(namespace="vars", "playlist_type", fun (s) -> begin set_playlist_type(s) "Done!" end)
|
||||
server.register(namespace="vars", "playlist_type", fun (s) -> begin set_playlist_type(s) "Done!" end)
|
||||
server.register(namespace="vars", "pypo_data", fun (s) -> begin set_pypo_data(s) "Done!" end)
|
13
3rd_party/pypo/scripts/include_notify.liq
vendored
13
3rd_party/pypo/scripts/include_notify.liq
vendored
|
@ -4,10 +4,10 @@
|
|||
|
||||
def notify(m)
|
||||
|
||||
print('user_id: #{!user_id}')
|
||||
print('playlist_id: #{!playlist_id}')
|
||||
print('transmission_id: #{!transmission_id}')
|
||||
print('playlist_type: #{!playlist_type}')
|
||||
# print('user_id: #{!user_id}')
|
||||
# print('playlist_id: #{!playlist_id}')
|
||||
# print('transmission_id: #{!transmission_id}')
|
||||
# print('playlist_type: #{!playlist_type}')
|
||||
|
||||
if !playlist_type=='5' then
|
||||
print('livesession')
|
||||
|
@ -20,8 +20,9 @@ def notify(m)
|
|||
end
|
||||
|
||||
if !playlist_type=='0' or !playlist_type=='1' or !playlist_type=='2' or !playlist_type=='3' or !playlist_type=='4' then
|
||||
print('playlist')
|
||||
system("./notify.sh --playing --playlist-type=#{!playlist_type} --media-id=#{m['media_id']} --export-source=#{m['export_source']}")
|
||||
print('include_notify.liq: notify on playlist')
|
||||
#system("./notify.sh --playing --playlist-type=#{!playlist_type} --media-id=#{m['media_id']} --export-source=#{m['export_source']}")
|
||||
system("./notify.sh --data='#{!pypo_data}' --media-id=#{m['media_id']}")
|
||||
end
|
||||
|
||||
end
|
3
3rd_party/pypo/scripts/ls_config.liq.dist
vendored
3
3rd_party/pypo/scripts/ls_config.liq.dist
vendored
|
@ -2,9 +2,6 @@
|
|||
# liquidsoap config file #
|
||||
###########################################
|
||||
|
||||
# author Jonas Ohrstrom <jonas@digris.ch>
|
||||
|
||||
|
||||
# this file is specific to the obp
|
||||
# installation. eg it assumes that there are
|
||||
# two instances of LS running
|
||||
|
|
2
3rd_party/pypo/scripts/ls_cue.liq
vendored
2
3rd_party/pypo/scripts/ls_cue.liq
vendored
|
@ -1,4 +1,4 @@
|
|||
# author Jonas Ohrstrom <jonas@digris.ch>
|
||||
|
||||
# Register the cut protocol
|
||||
def cue_protocol(arg,delay)
|
||||
# The extraction program
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue