Installer

This commit is contained in:
2024-03-30 17:23:05 +01:00
parent 1361f60d9b
commit d35c6539af
7 changed files with 82 additions and 4 deletions
+8
View File
@@ -203,6 +203,14 @@ class MusicFileList(object):
"""
return self.music_file_list
def update_file_list(self,item):
"""
The `update_file_list` function appends an item to a music file list and sends a POST request with
the item data to a file service address.
:param item: The `item` parameter in the `update_file_list` method is the file that you want to add
to the `music_file_list` attribute of the class instance. It is then sent as a JSON payload in a
POST request to a file service address along with the endpoint `SEND_MP3`
"""
self.music_file_list.append(item)
post_data = {"item" : str(item)}
requests.post(f'{FILE_SERVICE_ADDRESS}{SEND_MP3}', json=post_data, timeout = 360)