solved Schuffle default playlist

ondo
@ondo
4 years ago
17 posts
I would like to position a playlist in predefined schuffle mode. So that it is the user who overrides the "shuffle" mode if necessary
But I saw that the songs ranged at random when you click on "schuffle" and that it is not a "live" option which is located at the time of reading; Which makes me say that it may be impossible to achieve. But I ask the question because it is important enough for me, to give the chance to all the artists.
default scuffle.jpg
default scuffle.jpg  •  289KB


updated by @ondo: 11/25/20 04:07:57AM
paul
@paul
4 years ago
4,325 posts
At the moment Playlists can only play tracks in the order that they were added to the playlist.
I will open an internal tracker so that we can look into this and see whether its possible to add an option to randomise the playlist.
Thanks


--
Paul Asher - JR Developer and System Import Specialist
ondo
@ondo
4 years ago
17 posts
This function would be great !!
And make sense of a play list, as users rarely listen to more than 2 songs in a row.
paul
@paul
4 years ago
4,325 posts
You can make playlists play in a random order by replacing the code in the jrPlaylist item_detail.tpl template fle with this -

{jrCore_module_url module="jrPlaylist" assign="murl"}
<div class="block">

    <div class="title">
        <div class="block_config">
            {jrCore_item_detail_buttons module="jrPlaylist" item=$item}
        </div>
        <h1>{$item.playlist_title}</h1>
        <div class="breadcrumbs">
            <a href="{$jamroom_url}/{$item.profile_url}/">{$item.profile_name}</a> &raquo; <a href="{$jamroom_url}/{$item.profile_url}/{$murl}">{jrCore_lang module="jrPlaylist" id="9" default="Playlist"}</a> &raquo; {$item.playlist_title}
        </div>
    </div>

    <div class="block_content">

        {if $item.playlist_count > 0}

            {$_pl = $item.playlist_items}
            {capture}{shuffle($_pl)}{/capture}

            <div class="item">
                {assign var="ap" value="`$_conf.jrCore_active_skin`_auto_play"}
                {assign var="skin_player_type" value="`$_conf.jrCore_active_skin`_player_type"}
                {assign var="player_type" value=$_conf.$skin_player_type}
                {assign var="player" value="jrPlaylist_`$player_type`"}
                {if isset($player_type) && strlen($player_type) > 0}
                    {jrCore_media_player type=$player module="jrAudio" items=$_pl autoplay=$_conf.$ap}
                {else}
                    {jrCore_media_player module="jrAudio" item=$_pl autoplay=$_conf.$ap}
                {/if}

            </div>

            <section>
                <ul class="sortable list" style="list-style:none outside none;padding-left:0;">
                    {foreach $_pl as $playlist_item}
                        <li data-id="{$playlist_item.playlist_module}-{$playlist_item._item_id}">
                            {jrCore_include template=$item.playlist_templates[$playlist_item.playlist_module] module=$playlist_item.playlist_module playlist_id=$item._item_id}
                        </li>
                    {/foreach}
                </ul>
            </section>

            {* bring in module features *}
            {jrCore_item_detail_features module="jrPlaylist" item=$item}

        {else}

            <div class="item">{jrCore_lang module="jrPlaylist" id="44" default="This playlist is empty and no longer exists"}</div>

        {/if}

    </div>

</div>

hth


--
Paul Asher - JR Developer and System Import Specialist
ondo
@ondo
4 years ago
17 posts
it's really fantastic, I will test this right away
Thank you !!!
ondo
@ondo
4 years ago
17 posts
I have replaced, but order list don"t change...

https://ondomaniac.fr/radio_player/playlist_id=49/title=Generale/autoplay=true
replace.jpg
replace.jpg  •  666KB

paul
@paul
4 years ago
4,325 posts
After first making changes to templates using the ACP template editor you need to activate the edited template. I've done this for you and the playlists' tracks are now randomised - https://ondomaniac.fr/admin/playlist/49/generale
hth


--
Paul Asher - JR Developer and System Import Specialist
ondo
@ondo
4 years ago
17 posts
Yes, but bottom in home page (www.ondomaniac.fr) the link don't genere random list...
Your link is different.
ondo
@ondo
4 years ago
17 posts
This it copy-screen
exemple.jpg
exemple.jpg  •  297KB

paul
@paul
4 years ago
4,325 posts
I've made a similar change to the skin's radio_playlist.tpl template that controls that popup window. Remember that the window view is cached so the random order will not change immediately on subsequent openings.


--
Paul Asher - JR Developer and System Import Specialist
ondo
@ondo
4 years ago
17 posts
Ok that's fine, visitors will see the audio and video lists in home page change from time to time...
Thank you very much !
updated by @ondo: 08/26/20 09:58:27PM