From 2c04d2039a2a5b9b5f0f90c05e4d64d58a883577 Mon Sep 17 00:00:00 2001 From: Serhiy Zakharchenko Date: Wed, 16 Oct 2024 20:03:59 +0100 Subject: [PATCH] File upload fixes --- assets/js/fileupload.js | 10 +++++----- src/components/EpisodeSyncStatus.js | 1 - templates/metafields/episode_file.php | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/assets/js/fileupload.js b/assets/js/fileupload.js index d485feca..de2137ca 100644 --- a/assets/js/fileupload.js +++ b/assets/js/fileupload.js @@ -149,11 +149,11 @@ jQuery( document ).ready( function ( $ ) { var file = response.file, fileName = up.files[0].name; - $( "#podmotor_file_id" ).val( file.id ); - $( "#filesize_raw" ).val( file.file_size ); - $( "#filesize" ).val( plupload.formatSize( file.file_size ) ); - $( "#duration" ).val( file.file_duration ); - $( '#upload_audio_file' ).val( file.file_path ); + $( "#podmotor_file_id" ).val( file.id ).trigger('change'); + $( "#filesize_raw" ).val( file.file_size ).trigger('change'); + $( "#filesize" ).val( plupload.formatSize( file.file_size ) ).trigger('change'); + $( "#duration" ).val( file.file_duration ).trigger('change'); + $( '#upload_audio_file' ).val( file.file_path ).trigger('change'); $( '.peek-a-bar' ).fadeOut( 5000 ); $('#castos_file_data').val(JSON.stringify({ path: file.file_path, diff --git a/src/components/EpisodeSyncStatus.js b/src/components/EpisodeSyncStatus.js index 989b677a..80070137 100644 --- a/src/components/EpisodeSyncStatus.js +++ b/src/components/EpisodeSyncStatus.js @@ -77,7 +77,6 @@ const EpisodeSyncStatus = () => { // Check if the specified post type exists in the fetched data if (types[postType] && types[postType].rest_base) { - console.log('Returning rest base:', types[postType].rest_base); return types[postType].rest_base; } else { console.warn(`Post type "${postType}" not found.`); diff --git a/templates/metafields/episode_file.php b/templates/metafields/episode_file.php index c1434d70..2cc9decd 100644 --- a/templates/metafields/episode_file.php +++ b/templates/metafields/episode_file.php @@ -23,7 +23,7 @@