Skip to content

Commit

Permalink
Merge pull request #121 from JVT038/threading-attempt-two
Browse files Browse the repository at this point in the history
Fix bugs
  • Loading branch information
JVT038 authored Jan 28, 2024
2 parents 2a1acb5 + ee15824 commit fa56340
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions metatube/overview/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def searchmetadata(data):
socketio.start_background_task(Genius.searchsong, data, token)

@socketio.on('ytdl_download')
def download(fileData, metadata):
def download(fileData):
url = fileData["url"]
ext = fileData["ext"] or 'mp3'
output_folder = fileData["output_folder"] or '/downloads'
Expand All @@ -130,7 +130,7 @@ def download(fileData, metadata):
vaapi_device = hw_transcoding.split(';')[1] if 'vaapi' in hw_transcoding else ''
verbose = strtobool(str(env.LOGGER))
logger.info('Request to download %s', fileData["url"])
ytdl_options = yt.get_options(ext, output_folder, output_type, output_format, bitrate, skipfragments, proxy_data, ffmpeg, hw_transcoding, vaapi_device, width, height, verbose, metadata)
ytdl_options = yt.get_options(ext, output_folder, output_type, output_format, bitrate, skipfragments, proxy_data, ffmpeg, hw_transcoding, vaapi_device, width, height, verbose)
if ytdl_options is not False:
socketio.start_background_task(yt.start_download, url, ytdl_options)
# socketio.start_background_task(yt.download, url, ytdl_options)
Expand Down
4 changes: 2 additions & 2 deletions metatube/static/JS/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ $(document).ready(function() {
let namespan = document.createElement('span');
let namerow = document.createElement('div');

td_artist.innerText = itemdata["artist"].join('; ');
td_artist.innerText = itemdata["artist"]
td_album.innerText = itemdata["album"];
td_date.innerText = date;
td_ext.innerText = itemdata["filepath"].split('.')[itemdata["filepath"].split('.').length - 1].toUpperCase();
Expand Down Expand Up @@ -1461,7 +1461,7 @@ $(document).ready(function() {
'width': width,
'height': height
}
socket.emit('ytdl_download', data, getMetadata(), function(ack) {
socket.emit('ytdl_download', data, function(ack) {
if(ack == "OK") {
$("#editmetadata, #downloadbtn, #searchmetadataview, #404p, #defaultview, #resetviewbtn, #geniusbtn, #audiocol, #savemetadata, #metadataview, #geniuscol").addClass('d-none');
$("#progressview").removeClass('d-none');
Expand Down
2 changes: 1 addition & 1 deletion metatube/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def postprocessor_hook(d):
sockets.finished_postprocessor(d['postprocessor'], d['info_dict']['filepath'])

@staticmethod
def get_options(ext, output_folder, type, output_format, bitrate, skipfragments, proxy_data, ffmpeg, hw_transcoding, vaapi_device, width, height, verbose, metadata):
def get_options(ext, output_folder, type, output_format, bitrate, skipfragments, proxy_data, ffmpeg, hw_transcoding, vaapi_device, width, height, verbose):
proxy = json.loads(proxy_data)
filepath = os.path.join(output_folder, output_format)
segments = json.loads(skipfragments)
Expand Down

0 comments on commit fa56340

Please sign in to comment.