solved How to make lists?

Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
I want to make a top ten list of the songs uploaded to my site but i dont want the same band to take over the entire list how do i set it so it only shows one song per band? so it could be top ten bands on site?
updated by @zachary-moonshine: 03/19/16 04:41:57PM
douglas
@douglas
10 years ago
2,807 posts
You could use group_by="song_album" in your jrCore_list function.

{jrCore_list module="jrAudio" order_by="audio_file_stream_count numeric_desc" limit="10" group_by="song_album" require_image="audio_image"}

This will show the top 10 most played tracks by album. You might even be able to group_by artist name.

{jrCore_list module="jrAudio" order_by="audio_file_stream_count numeric_desc" limit="10" group_by="profile_name" require_image="audio_image"}



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
ok let me try that thanks
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
also i dont want interviews showing up in the list, i want to use this for a contest so i want it to only be songs the interviews we have are tagged as interview by genre so when i tell the list to does not contain interview it should remove them from list but does not seem to work is this a bug?
paul
@paul
10 years ago
4,335 posts
Add a search function to the jrCore_list call -

search="audio_genre != interview"


--
Paul Asher - JR Developer and System Import Specialist
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
If i make a list of top 5 youtube videos based on stream count and i select to order them by stream count is it using the sites stream count or youtubes stream count?
paul
@paul
10 years ago
4,335 posts
It would use the site stream count.


--
Paul Asher - JR Developer and System Import Specialist
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
ok cool i think i have this all set up correctly now
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
this is not working at all some songs may have hundreds of plays and not even in the list ??? this is creating massive problem for me since i have a contest running for bands to get most plays and a list of teh top ten most played songs but it is in correct ??? is this a glitch or am i doing something wrong?
douglas
@douglas
10 years ago
2,807 posts
Can you show us what your using for your jrCore_list?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
yes give me a second i will take a picture
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
this is what i have it set up as
Capture3.PNG.png
Capture3.PNG.png  •  131KB

Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
the problem is it is showing tracks that have like 9 plays as the top played songs but i have songs on site with almost 1000 plays and they are not in the list ?
douglas
@douglas
10 years ago
2,807 posts
Are you using the latest version of Site Builder?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
yes
paul
@paul
10 years ago
4,335 posts
I wonder if this is because you have the 'group_by' set? If there are several songs by the same artist in the list it might not return the artist's song with the highest number of plays. Temporarily take out that group_by and let me know what it does.
Thanks


--
Paul Asher - JR Developer and System Import Specialist
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
i have tried every combination and without the group by as well still not showing top played songs?
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
has anyone ever tried to do this yet? are there any examples of it working ?
michael
@michael
10 years ago
7,821 posts
What is audio_file_genre? Are you sure there is one of them that contains the word 'interview'?

I don't have that datastore field here.

Start with simple queries, check they work, then build on them to filter down to what you want.
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
yeah my djs that upload interviews always label them as interview genre
michael
@michael
10 years ago
7,821 posts
and that exists in your datastore in the audio_file_genre field? Because your query should be working to return:

* audio items that do not have 'interview' in the 'audio_file_genre'. There will only be 1 result returned for each unique value in the audio_file_artist value.
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
well i removed that from the settings of the list and it is still showing tracks out of order not by stream count, all i am trying to do is show the top ten tracks by stream count in order?
paul
@paul
10 years ago
4,335 posts
Can you send your admin login to support[at]jamroom[dot]net so that we can check this out?
Thanks


--
Paul Asher - JR Developer and System Import Specialist
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
yes i will send now @paul
paul
@paul
10 years ago
4,335 posts
Thanks Zach - See how I have this set up at http://metaldevastationradio.com/test - it orders songs by 'most played' and excludes songs with the genre 'interview'.
The problem comes when you try to add in a 'group by' so as to only show one song per artist. The issue is in the way the MySql responds to the database query in that it will return the song entry of the first artist in finds in the group, which will not necessarily be the artist's song with the most plays. The returned songs are then ordered.
This is a limitation of the way MySql works on a php server and there is not much that Jamroom can do about it directly.
The alternative might be to do something clever in the template to filter out duplicate artists. I will check that out for you.


--
Paul Asher - JR Developer and System Import Specialist
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
ahh yess thank you much better i see the custom code in template too, copied everything n put it on my home page this works well
paul
@paul
10 years ago
4,335 posts
FYI - The custom code isn't necessary, I just added it in so as to include the actual number of plays per song. The default template doesn't include that info.


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
10 years ago
4,335 posts
Yes - Can now confirm that nothing can be done to eliminate multiple artists from this list by using the widget parameters, so have implemented it in the template. Take a look at http://metaldevastationradio.com/test now.
Its a bit of a sprag as to show a list of 10 top songs, we ask for more than that (25) then filter out duplicate artist names in the template foreach loop (hoping that we have enough unique artists to make up the ten needed!!).

For anyone else who is interested in how this is done, here is the basic code logic -
{jrCore_module_url module="jrAudio" assign="murl"}
{if isset($_items)}
	{$ctr = 0}
    {foreach from=$_items item="item"}
		{if $ctr == 10}
            {break}
        {/if}
        {if !isset($_tmp["`$item['profile_name']`"])}
            {jrCore_array name='_tmp' key=$item['profile_name'] value=1}
            {$ctr = $ctr + 1}
            {**** Code to show the item here ****}
        {/if}
    {/foreach}
{/if}



--
Paul Asher - JR Developer and System Import Specialist
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
10 years ago
831 posts
thanks man the number of song plays is very important and looks cool very happy with the lists now