2021-12-09 Fred Gleason <fredg@paravelsystems.com>

* Added a 'PostPodcast()' method to the 'rivwebpyapi' API.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-12-09 15:21:03 -05:00
parent e3db96770d
commit e00bf0c53f
4 changed files with 106 additions and 0 deletions

View File

@@ -1730,6 +1730,36 @@ class rivwebpyapi(object):
return handler.output()[0]
def PostPodcast(self,cast_id):
"""
Upload podcast audio from the Rivendell audio store to the
remote archive.
Takes the following argument:
cast_id - ID of the owning podcast item (integer).
"""
if(cast_id<0):
raise ValueError('invalid podcast ID')
#
# Build the WebAPI arguments
#
postdata={
'COMMAND': '40',
'LOGIN_NAME': self.__connection_username,
'PASSWORD': self.__connection_password,
'ID': str(cast_id)
}
#
# Fetch the audio data
#
r=requests.post(self.__connection_url,data=postdata)
if(r.status_code!=requests.codes.ok):
self.__throwError(response=r)
def Rehash(self,cart_number,cut_number):
"""
Update the SHA1 hash entry in the database from the contents of