closed Chart counts don't work correct

Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
10 years ago
224 posts
Hi,

I wonder how the charts work. i have set a start date and an end date. following is my problem:

in example today is wednesday
my charts are updated on monday, so the start date is on last monday and the enddate is the sunday. But if today is wednesday and yesterday were some songs uploaded, this songs are shown in the chart listing from last week too.

this is my code:

{* SET END_DAY : su=0 mo=1 tu=2 we=3 th=4 fr=5 sa=6 *}
{assign var="end_day" value="0"}				
{assign var="x" value=$smarty.now|date_format:"%w"}			
{if $x == $end_day}{assign var="x" value=$x+7}{/if}
{assign var="difference" value=$x-$end_day}
{if $difference < 0}{assign var="difference" value=$difference+7}{/if}
{assign var="start_date" value=$smarty.now-$difference*86400}
{assign var="start_date" value=$start_date-518400}
{assign var="start_date" value=$start_date|date_format:"%Y%m%d"}
{assign var="end_date" value=$smarty.now-$difference*86400}
{assign var="release_date" value=$end_date+86400}
{assign var="end_date" value=$end_date|date_format:"%Y%m%d"}

{jrCore_list 	    module="jrAudio" 
    		    chart_field="audio_file_stream_count" 
                    template="charts_row.tpl" 
                    chart_day_start=$start_date 
                    chart_day_end=$end_date
                    pagebreak="50" 
                    show="50"}

The Code to get the right date is working correctly. But the results in the chart listings aren't correct.
updated by @bandwerkstatt: 12/22/14 08:50:13PM
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
10 years ago
224 posts
To know what i mean, i have installed the system on monday and uploaded the songs yesterday. So the list must be empty. But all Songs are listed for last week.
updated by @bandwerkstatt: 11/12/14 12:10:54PM
brian
@brian
10 years ago
10,148 posts
SelfmadeClub:
To know what i mean, i have installed the system on monday and uploaded the songs yesterday. So the list must be empty. But all Songs are listed for last week.

If there is NO DATA for the start time, then it reverts to the oldest entries in the chart DB - i.e. if you ask for a 7 day chart, but only have data for the last 4 days, it will be a 4 day chart.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
10 years ago
224 posts
Thx Brain, i will think about it.
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
10 years ago
224 posts
Weeks charts:

I have another question to the function of the charts.

If we follow the following example:

The charts should go from Monday 0:00 o'clock till Sunday 23:59 o'clock.
From Sunday on Monday a new week begins, therefore the charts restart.

Is it possible for Jamroom to store charts the weeks firmly?
What do I mean with it?

We use the weeks to charts for a radio broadcasting. If we present on Monday to the customers the charts of the last week, the orders are not any more precisely in such a way as they were freshly updated on Sunday.

Topically we manage in such a way that we write an article and store away in it the weeks charts. The system does not change therefore the weeks Chart orders and these are callable always correctly.

Is Jamroom able such a thing also automatically?

Sorry, if my english is bad. I´ll try my best to explained it to you :)

Stefan
brian
@brian
10 years ago
10,148 posts
SelfmadeClub:
Weeks charts:

I have another question to the function of the charts.

If we follow the following example:

The charts should go from Monday 0:00 o'clock till Sunday 23:59 o'clock.
From Sunday on Monday a new week begins, therefore the charts restart.

Is it possible for Jamroom to store charts the weeks firmly?
What do I mean with it?

We use the weeks to charts for a radio broadcasting. If we present on Monday to the customers the charts of the last week, the orders are not any more precisely in such a way as they were freshly updated on Sunday.

Topically we manage in such a way that we write an article and store away in it the weeks charts. The system does not change therefore the weeks Chart orders and these are callable always correctly.

Is Jamroom able such a thing also automatically?

Sorry, if my english is bad. I´ll try my best to explained it to you :)

Stefan

No worries - I think I get what you mean. Do you mean you want to be able to view LAST WEEK's chart (Monday 0:00 o'clock till Sunday 23:59 o'clock) on the following Monday (or basically at any later date?)

Let me know if that is what you mean.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
10 years ago
224 posts
Hello, Brain.

Many thanks for your understanding! ☺

I try to describe it once again more detailed:

Yes, it is about the weeks charts. These should be valid(apply) from Monday till Sunday, from the next day the new week counts(belongs).

However, problem is if the following case enters:

If two customers have the same(identical) number(quantity) of downloads and Plays, Jamroom does not take this on the same(identical) place. Depending on how the Cache is put(stopped) and when I call the charts once more, it can happen that before place 2, now place 3 is and vice versa.

To handle this, we have written an article(item) and there have copied the charts purely. Therefore we could guarantee, all the same when the customer the past weeks has called charts, the Chart orders are always same(identical).

I hope, now I could better explain myself(declare).

Thank me once more for your time and understanding!

Many greetings from Germany and thanks for Jamroom.

Stefan
updated by @bandwerkstatt: 11/13/14 09:07:43AM
brian
@brian
10 years ago
10,148 posts
SelfmadeClub:
If two customers have the same(identical) number(quantity) of downloads and Plays, Jamroom does not take this on the same(identical) place. Depending on how the Cache is put(stopped) and when I call the charts once more, it can happen that before place 2, now place 3 is and vice versa.

This is due to how MySQL returns results when they have the same value and an order_by has been applied - there is no "guarantee" that they will always be in the same order.

If 2 items have an identical count value over the chart_days, what field should then be used to determine the (secondary) result order?

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags