<?php get_header();
    $term_id         = get_queried_object_id();
    $term            = get_queried_object();
    $episode         = new TOROFLIX_Episode;
    $links           = $episode->tr_links_episodes($term_id);
    $links['online'] = !empty($links['online']) ? $links['online'] : '';
    $serie_id        = $episode->get_serie_id($term_id);
    $slug            = $term->slug;

    $data = array(
                'links'    => $links, 
                'serie_id' => $serie_id, 
                'term'     => $term, 
                'slug'     => $slug, 
                'term_id'  => $term_id
            );
    ?>
    <div class="Body">
        
        <?php 
        if($links['online']) {
            get_template_part( 'public/partials/template/episode/episode', 'link', array( 'term_id' => $term_id, 'term' => $term ) ); 
        } else { ?>
            <div class="MovieListSldCn">
                <?php get_template_part( 'public/partials/template/episode/episode', 'nolink', array( 'term_id' => $term_id, 'term' => $term, 'image' => true ) ); ?>
            </div>
        <?php } ?>

        <div class="Main Container">
            <?php do_action( 'episode_content', $data );
                    #10: Carousel letter
                    #20: Info
                    #30: Related ?>
        </div>
    </div>
<?php get_footer(); ?>