SAAS-772: Send metadata to Tunein
Made Improvement so Airtime always makes a request to TuneIn every 4 minutes so TuneIn does not turn metadata off
This commit is contained in:
parent
fc02de4920
commit
532bd1ea85
7 changed files with 59 additions and 26 deletions
|
@ -83,6 +83,7 @@ api_config['push_stream_stats'] = 'push-stream-stats/api_key/%%api_key%%/format/
|
|||
api_config['update_stream_setting_table'] = 'update-stream-setting-table/api_key/%%api_key%%/format/json'
|
||||
api_config['get_files_without_silan_value'] = 'get-files-without-silan-value/api_key/%%api_key%%'
|
||||
api_config['update_cue_values_by_silan'] = 'update-cue-values-by-silan/api_key/%%api_key%%'
|
||||
api_config['update_metadata_on_tunein'] = 'update-metadata-on-tunein/api_key/%%api_key%%'
|
||||
|
||||
|
||||
|
||||
|
@ -530,6 +531,9 @@ class AirtimeApiClient(object):
|
|||
#TODO
|
||||
self.logger.error(str(e))
|
||||
|
||||
def update_metadata_on_tunein(self):
|
||||
self.services.update_metadata_on_tunein()
|
||||
|
||||
|
||||
class InvalidContentType(Exception):
|
||||
pass
|
||||
|
|
|
@ -14,7 +14,7 @@ import traceback
|
|||
import pure
|
||||
|
||||
from Queue import Empty
|
||||
from threading import Thread
|
||||
from threading import Thread, Timer
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
from api_clients import api_client
|
||||
|
@ -447,6 +447,12 @@ class PypoFetch(Thread):
|
|||
|
||||
return success
|
||||
|
||||
# This function makes a request to Airtime to see if we need to
|
||||
# push metadata to TuneIn. We have to do this because TuneIn turns
|
||||
# off metadata if it does not receive a request every 5 minutes.
|
||||
def update_metadata_on_tunein(self):
|
||||
self.api_client.update_metadata_on_tunein()
|
||||
Timer(120, self.update_metadata_on_tunein).start()
|
||||
|
||||
def main(self):
|
||||
#Make sure all Liquidsoap queues are empty. This is important in the
|
||||
|
@ -458,8 +464,10 @@ class PypoFetch(Thread):
|
|||
|
||||
self.set_bootstrap_variables()
|
||||
|
||||
self.update_metadata_on_tunein()
|
||||
|
||||
# Bootstrap: since we are just starting up, we need to grab the
|
||||
# most recent schedule. After that we fetch the schedule every 30
|
||||
# most recent schedule. After that we fetch the schedule every 8
|
||||
# minutes or wait for schedule updates to get pushed.
|
||||
success = self.persistent_manual_schedule_fetch(max_attempts=5)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue