Plugin Directory

Changeset 3294292


Ignore:
Timestamp:
05/15/2025 04:06:28 PM (8 months ago)
Author:
rtcamp
Message:

Update to version 1.0.5 from GitHub

Location:
godam
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • godam/tags/1.0.5/admin/class-rtgodam-transcoder-handler.php

    r3293354 r3294292  
    535535        }
    536536
     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
    537551        update_post_meta( $post_id, 'rtgodam_media_source', $post_thumbs_array['job_for'] );
    538552        update_post_meta( $post_id, 'rtgodam_media_thumbnails', $upload_thumbnail_array );
     
    540554        do_action( 'rtgodam_transcoded_thumbnails_added', $post_id );
    541555
    542         if ( $largest_thumb ) {
     556        if ( $largest_thumb_url ) {
    543557
    544558            $is_retranscoding_job = get_post_meta( $post_id, 'rtgodam_retranscoding_sent', true );
    545559
    546560            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                }
    547567
    548568                update_post_meta( $post_id, 'rtgodam_media_video_thumbnail', $largest_thumb );
  • godam/tags/1.0.5/admin/godam-transcoder-actions.php

    r3270974 r3294292  
    102102
    103103add_action( 'init', 'rtgodam_register_transcoded_url_meta' );
     104
     105
     106
     107if ( ! 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
     149add_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 */
     158function 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
     175add_action( 'rtgodam_transcoded_thumb_added', 'rtt_update_wp_media_thumbnail', 10, 2 );
  • godam/tags/1.0.5/godam.php

    r3293354 r3294292  
    44 * Plugin URI: https://godam.io
    55 * 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.4
     6 * Version: 1.0.5
    77 * Text Domain: godam
    88 * Author: rtCamp
     
    4242     * The version of the plugin
    4343     */
    44     define( 'RTGODAM_VERSION', '1.0.4' );
     44    define( 'RTGODAM_VERSION', '1.0.5' );
    4545}
    4646
     
    140140 */
    141141function load_godam_textdomain() {
    142     load_plugin_textdomain( 'godam' );
     142    load_plugin_textdomain( 'godam', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    143143}
  • godam/tags/1.0.5/readme.txt

    r3293354 r3294292  
    55Tested up to: 6.8.1
    66Requires PHP: 7.4
    7 Stable tag: 1.0.4
     7Stable tag: 1.0.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    185185- Feat: Introduced the new GoDAM Audio Block for displaying audio content from CDN.
    186186
     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
    187191== External Services ==
    188192This 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  
    535535        }
    536536
     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
    537551        update_post_meta( $post_id, 'rtgodam_media_source', $post_thumbs_array['job_for'] );
    538552        update_post_meta( $post_id, 'rtgodam_media_thumbnails', $upload_thumbnail_array );
     
    540554        do_action( 'rtgodam_transcoded_thumbnails_added', $post_id );
    541555
    542         if ( $largest_thumb ) {
     556        if ( $largest_thumb_url ) {
    543557
    544558            $is_retranscoding_job = get_post_meta( $post_id, 'rtgodam_retranscoding_sent', true );
    545559
    546560            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                }
    547567
    548568                update_post_meta( $post_id, 'rtgodam_media_video_thumbnail', $largest_thumb );
  • godam/trunk/admin/godam-transcoder-actions.php

    r3270974 r3294292  
    102102
    103103add_action( 'init', 'rtgodam_register_transcoded_url_meta' );
     104
     105
     106
     107if ( ! 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
     149add_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 */
     158function 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
     175add_action( 'rtgodam_transcoded_thumb_added', 'rtt_update_wp_media_thumbnail', 10, 2 );
  • godam/trunk/godam.php

    r3293354 r3294292  
    44 * Plugin URI: https://godam.io
    55 * 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.4
     6 * Version: 1.0.5
    77 * Text Domain: godam
    88 * Author: rtCamp
     
    4242     * The version of the plugin
    4343     */
    44     define( 'RTGODAM_VERSION', '1.0.4' );
     44    define( 'RTGODAM_VERSION', '1.0.5' );
    4545}
    4646
     
    140140 */
    141141function load_godam_textdomain() {
    142     load_plugin_textdomain( 'godam' );
     142    load_plugin_textdomain( 'godam', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    143143}
  • godam/trunk/readme.txt

    r3293354 r3294292  
    55Tested up to: 6.8.1
    66Requires PHP: 7.4
    7 Stable tag: 1.0.4
     7Stable tag: 1.0.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    185185- Feat: Introduced the new GoDAM Audio Block for displaying audio content from CDN.
    186186
     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
    187191== External Services ==
    188192This 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.