Changeset 3294292
- Timestamp:
- 05/15/2025 04:06:28 PM (8 months ago)
- Location:
- godam
- Files:
-
- 8 edited
- 1 copied
-
tags/1.0.5 (copied) (copied from godam/trunk)
-
tags/1.0.5/admin/class-rtgodam-transcoder-handler.php (modified) (2 diffs)
-
tags/1.0.5/admin/godam-transcoder-actions.php (modified) (1 diff)
-
tags/1.0.5/godam.php (modified) (3 diffs)
-
tags/1.0.5/readme.txt (modified) (2 diffs)
-
trunk/admin/class-rtgodam-transcoder-handler.php (modified) (2 diffs)
-
trunk/admin/godam-transcoder-actions.php (modified) (1 diff)
-
trunk/godam.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
godam/tags/1.0.5/admin/class-rtgodam-transcoder-handler.php
r3293354 r3294292 535 535 } 536 536 537 if ( class_exists( 'RTMediaModel' ) ) { 538 $model = new RTMediaModel(); 539 $media = $model->get( array( 'media_id' => $post_id ) ); 540 $media_id = $media[0]->id; 541 542 $this->media_author = $media[0]->media_author; 543 $this->uploaded['context'] = $media[0]->context; 544 $this->uploaded['context_id'] = $media[0]->context_id; 545 $this->uploaded['media_author'] = $media[0]->media_author; 546 } 547 548 update_post_meta( $post_id, '_rt_media_source', $post_thumbs_array['job_for'] ); 549 update_post_meta( $post_id, '_rt_media_thumbnails', $upload_thumbnail_array ); 550 537 551 update_post_meta( $post_id, 'rtgodam_media_source', $post_thumbs_array['job_for'] ); 538 552 update_post_meta( $post_id, 'rtgodam_media_thumbnails', $upload_thumbnail_array ); … … 540 554 do_action( 'rtgodam_transcoded_thumbnails_added', $post_id ); 541 555 542 if ( $largest_thumb ) {556 if ( $largest_thumb_url ) { 543 557 544 558 $is_retranscoding_job = get_post_meta( $post_id, 'rtgodam_retranscoding_sent', true ); 545 559 546 560 if ( ! $is_retranscoding_job || rtgodam_is_override_thumbnail() ) { 561 update_post_meta( $post_id, '_rt_media_video_thumbnail', $largest_thumb_url ); 562 563 if ( class_exists( 'RTMediaModel' ) ) { 564 $model->update( array( 'cover_art' => $largest_thumb ), array( 'media_id' => $post_id ) ); 565 update_activity_after_thumb_set( $media_id ); 566 } 547 567 548 568 update_post_meta( $post_id, 'rtgodam_media_video_thumbnail', $largest_thumb ); -
godam/tags/1.0.5/admin/godam-transcoder-actions.php
r3270974 r3294292 102 102 103 103 add_action( 'init', 'rtgodam_register_transcoded_url_meta' ); 104 105 106 107 if ( ! function_exists( 'rtt_set_video_thumbnail' ) ) { 108 109 /** 110 * Set the video thumbnail 111 * 112 * @since 1.0.0 113 * 114 * @param number $id rtMedia activity ID. 115 */ 116 function rtt_set_video_thumbnail( $id ) { 117 $media_type = rtmedia_type( $id ); 118 $attachment_id = rtmedia_media_id( $id ); // Get the wp attachment ID. 119 $thumbnail = rtgodam_filter_input( INPUT_POST, 'rtmedia-thumbnail', FILTER_SANITIZE_URL ); 120 if ( 'video' === $media_type && ! empty( $thumbnail ) ) { 121 122 if ( ! is_numeric( $thumbnail ) ) { 123 $file_url = $thumbnail; 124 /* for WordPress backward compatibility */ 125 if ( function_exists( 'wp_get_upload_dir' ) ) { 126 $uploads = wp_get_upload_dir(); 127 } else { 128 $uploads = wp_upload_dir(); 129 } 130 if ( 0 === strpos( $file_url, $uploads['baseurl'] ) ) { 131 $final_file_url = $file_url; 132 } else { 133 $final_file_url = $uploads['baseurl'] . '/' . $file_url; 134 } 135 136 $final_file_url = apply_filters( 'transcoded_file_url', $final_file_url, $attachment_id ); 137 138 update_post_meta( $attachment_id, '_rt_media_video_thumbnail', $thumbnail ); 139 } 140 141 $model = new RTMediaModel(); 142 $model->update( array( 'cover_art' => $final_file_url ), array( 'id' => intval( $id ) ) ); 143 rtt_update_activity_after_thumb_set( $id ); 144 145 } 146 } 147 } 148 149 add_action( 'rtmedia_after_update_media', 'rtt_set_video_thumbnail', 12 ); 150 151 /** 152 * Set the cover art/video thumbnail for the videos which are not uploaded from the rtMedia activity 153 * 154 * @since 1.0.7 155 * @param string $thumb_url Video thumbnail URL. 156 * @param int $attachment_id Attachment ID of the media/video for which thumbnail has to be set. 157 */ 158 function rtt_update_wp_media_thumbnail( $thumb_url, $attachment_id ) { 159 if ( class_exists( 'RTMediaModel' ) ) { 160 $model = new RTMediaModel(); 161 $media = $model->get( array( 'media_id' => $attachment_id ) ); 162 163 if ( ! empty( $media ) && ! empty( $media[0] ) ) { 164 $attachment_id = $media[0]->media_id; 165 $media_type = $media[0]->media_type; 166 $cover_art = $media[0]->cover_art; 167 168 if ( 'video' === $media_type && empty( $cover_art ) && ! empty( $thumb_url ) ) { 169 $model->update( array( 'cover_art' => $thumb_url ), array( 'media_id' => $attachment_id ) ); 170 } 171 } 172 } 173 } 174 175 add_action( 'rtgodam_transcoded_thumb_added', 'rtt_update_wp_media_thumbnail', 10, 2 ); -
godam/tags/1.0.5/godam.php
r3293354 r3294292 4 4 * Plugin URI: https://godam.io 5 5 * Description: Seamlessly manage and optimize digital assets with GoDAM – featuring transcoding, adaptive streaming, interactive video layers, gravity forms integration, and ad integration. 6 * Version: 1.0. 46 * Version: 1.0.5 7 7 * Text Domain: godam 8 8 * Author: rtCamp … … 42 42 * The version of the plugin 43 43 */ 44 define( 'RTGODAM_VERSION', '1.0. 4' );44 define( 'RTGODAM_VERSION', '1.0.5' ); 45 45 } 46 46 … … 140 140 */ 141 141 function load_godam_textdomain() { 142 load_plugin_textdomain( 'godam' );142 load_plugin_textdomain( 'godam', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 143 143 } -
godam/tags/1.0.5/readme.txt
r3293354 r3294292 5 5 Tested up to: 6.8.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 47 Stable tag: 1.0.5 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 185 185 - Feat: Introduced the new GoDAM Audio Block for displaying audio content from CDN. 186 186 187 = v1.0.5 (May 15, 2025) = 188 - Fix: Updated plugin to support translations and localization. 189 - Enhancement: Added compatibility for displaying thumbnails in the rtMedia gallery view. 190 187 191 == External Services == 188 192 This plugin relies on third-party services to provide specific features. Below is a detailed explanation of the external services used, what data is sent, and under what conditions. -
godam/trunk/admin/class-rtgodam-transcoder-handler.php
r3293354 r3294292 535 535 } 536 536 537 if ( class_exists( 'RTMediaModel' ) ) { 538 $model = new RTMediaModel(); 539 $media = $model->get( array( 'media_id' => $post_id ) ); 540 $media_id = $media[0]->id; 541 542 $this->media_author = $media[0]->media_author; 543 $this->uploaded['context'] = $media[0]->context; 544 $this->uploaded['context_id'] = $media[0]->context_id; 545 $this->uploaded['media_author'] = $media[0]->media_author; 546 } 547 548 update_post_meta( $post_id, '_rt_media_source', $post_thumbs_array['job_for'] ); 549 update_post_meta( $post_id, '_rt_media_thumbnails', $upload_thumbnail_array ); 550 537 551 update_post_meta( $post_id, 'rtgodam_media_source', $post_thumbs_array['job_for'] ); 538 552 update_post_meta( $post_id, 'rtgodam_media_thumbnails', $upload_thumbnail_array ); … … 540 554 do_action( 'rtgodam_transcoded_thumbnails_added', $post_id ); 541 555 542 if ( $largest_thumb ) {556 if ( $largest_thumb_url ) { 543 557 544 558 $is_retranscoding_job = get_post_meta( $post_id, 'rtgodam_retranscoding_sent', true ); 545 559 546 560 if ( ! $is_retranscoding_job || rtgodam_is_override_thumbnail() ) { 561 update_post_meta( $post_id, '_rt_media_video_thumbnail', $largest_thumb_url ); 562 563 if ( class_exists( 'RTMediaModel' ) ) { 564 $model->update( array( 'cover_art' => $largest_thumb ), array( 'media_id' => $post_id ) ); 565 update_activity_after_thumb_set( $media_id ); 566 } 547 567 548 568 update_post_meta( $post_id, 'rtgodam_media_video_thumbnail', $largest_thumb ); -
godam/trunk/admin/godam-transcoder-actions.php
r3270974 r3294292 102 102 103 103 add_action( 'init', 'rtgodam_register_transcoded_url_meta' ); 104 105 106 107 if ( ! function_exists( 'rtt_set_video_thumbnail' ) ) { 108 109 /** 110 * Set the video thumbnail 111 * 112 * @since 1.0.0 113 * 114 * @param number $id rtMedia activity ID. 115 */ 116 function rtt_set_video_thumbnail( $id ) { 117 $media_type = rtmedia_type( $id ); 118 $attachment_id = rtmedia_media_id( $id ); // Get the wp attachment ID. 119 $thumbnail = rtgodam_filter_input( INPUT_POST, 'rtmedia-thumbnail', FILTER_SANITIZE_URL ); 120 if ( 'video' === $media_type && ! empty( $thumbnail ) ) { 121 122 if ( ! is_numeric( $thumbnail ) ) { 123 $file_url = $thumbnail; 124 /* for WordPress backward compatibility */ 125 if ( function_exists( 'wp_get_upload_dir' ) ) { 126 $uploads = wp_get_upload_dir(); 127 } else { 128 $uploads = wp_upload_dir(); 129 } 130 if ( 0 === strpos( $file_url, $uploads['baseurl'] ) ) { 131 $final_file_url = $file_url; 132 } else { 133 $final_file_url = $uploads['baseurl'] . '/' . $file_url; 134 } 135 136 $final_file_url = apply_filters( 'transcoded_file_url', $final_file_url, $attachment_id ); 137 138 update_post_meta( $attachment_id, '_rt_media_video_thumbnail', $thumbnail ); 139 } 140 141 $model = new RTMediaModel(); 142 $model->update( array( 'cover_art' => $final_file_url ), array( 'id' => intval( $id ) ) ); 143 rtt_update_activity_after_thumb_set( $id ); 144 145 } 146 } 147 } 148 149 add_action( 'rtmedia_after_update_media', 'rtt_set_video_thumbnail', 12 ); 150 151 /** 152 * Set the cover art/video thumbnail for the videos which are not uploaded from the rtMedia activity 153 * 154 * @since 1.0.7 155 * @param string $thumb_url Video thumbnail URL. 156 * @param int $attachment_id Attachment ID of the media/video for which thumbnail has to be set. 157 */ 158 function rtt_update_wp_media_thumbnail( $thumb_url, $attachment_id ) { 159 if ( class_exists( 'RTMediaModel' ) ) { 160 $model = new RTMediaModel(); 161 $media = $model->get( array( 'media_id' => $attachment_id ) ); 162 163 if ( ! empty( $media ) && ! empty( $media[0] ) ) { 164 $attachment_id = $media[0]->media_id; 165 $media_type = $media[0]->media_type; 166 $cover_art = $media[0]->cover_art; 167 168 if ( 'video' === $media_type && empty( $cover_art ) && ! empty( $thumb_url ) ) { 169 $model->update( array( 'cover_art' => $thumb_url ), array( 'media_id' => $attachment_id ) ); 170 } 171 } 172 } 173 } 174 175 add_action( 'rtgodam_transcoded_thumb_added', 'rtt_update_wp_media_thumbnail', 10, 2 ); -
godam/trunk/godam.php
r3293354 r3294292 4 4 * Plugin URI: https://godam.io 5 5 * Description: Seamlessly manage and optimize digital assets with GoDAM – featuring transcoding, adaptive streaming, interactive video layers, gravity forms integration, and ad integration. 6 * Version: 1.0. 46 * Version: 1.0.5 7 7 * Text Domain: godam 8 8 * Author: rtCamp … … 42 42 * The version of the plugin 43 43 */ 44 define( 'RTGODAM_VERSION', '1.0. 4' );44 define( 'RTGODAM_VERSION', '1.0.5' ); 45 45 } 46 46 … … 140 140 */ 141 141 function load_godam_textdomain() { 142 load_plugin_textdomain( 'godam' );142 load_plugin_textdomain( 'godam', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 143 143 } -
godam/trunk/readme.txt
r3293354 r3294292 5 5 Tested up to: 6.8.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 47 Stable tag: 1.0.5 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 185 185 - Feat: Introduced the new GoDAM Audio Block for displaying audio content from CDN. 186 186 187 = v1.0.5 (May 15, 2025) = 188 - Fix: Updated plugin to support translations and localization. 189 - Enhancement: Added compatibility for displaying thumbnails in the rtMedia gallery view. 190 187 191 == External Services == 188 192 This plugin relies on third-party services to provide specific features. Below is a detailed explanation of the external services used, what data is sent, and under what conditions.
Note: See TracChangeset
for help on using the changeset viewer.