Skip to Content
It is currently November 29th, 2022, 7:31 pm

All times are UTC - 6 hours [ DST ]




 [ 7 posts ] 
Author Message
 Post subject: reset top ten list
PostPosted: February 1st, 2015, 12:21 pm 
Offline
Junior User
Junior User

Joined: May 31st, 2014, 8:18 am
Posts: 61
Does anyone know how to reset the top 10 list in Sam that appears on a web site. I am using MySQL if that matters


Top
 Profile  
 
 Post subject: Re: reset top ten list
PostPosted: February 1st, 2015, 2:25 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
Reset the playcount in all of your files is the only way to do so.
Something like this should work:
Code:
UPDATE songlist SET playcount = 0;

Though, I'm not 100% sure about the name of the playcount field. Could as well be count_played or played_count or something like that.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
 
 Post subject: Re: reset top ten list
PostPosted: February 1st, 2015, 2:47 pm 
Offline
Experienced User
Experienced User

Joined: September 28th, 2004, 10:22 pm
Posts: 257
Location: Seattle, WA
Mastacheata wrote:
Reset the playcount in all of your files is the only way to do so.
Something like this should work:
Code:
UPDATE songlist SET playcount = 0;

Though, I'm not 100% sure about the name of the playcount field. Could as well be count_played or played_count or something like that.


It's count_played.

_________________
DJ Meatwad
former Owner/Webmaster, Head Case Radio
(13 September 2004 - 2 July 2016)


Top
 Profile  
 
 Post subject: Re: reset top ten list
PostPosted: February 2nd, 2015, 8:51 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10572
Location: Denver, CO
The TOP 10 List is the TOP REQUESTED not TOP PLAYED. count_played is NOT the field you want to reset. it is count_requested. HOWEVER, IMHO that is a bad idea, A properly formated sql query would count just the requests in TIME period you seek without destroying the integrity of the data.

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
 
 Post subject: Re: reset top ten list
PostPosted: February 2nd, 2015, 2:31 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
Well, then it's count_requested.
But still, it's the only option you have without modifying the original templates.
Also you can always recover the count_requested from the requestlist table, so it's not an irreversible action.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
 
 Post subject: Re: reset top ten list
PostPosted: August 30th, 2022, 5:26 am 
Offline
Senior User
Senior User

Joined: September 24th, 2007, 2:01 pm
Posts: 198
I know this is an old thread but it is relevant to my question.

DJ Cassio said "A properly formated sql query would count just the requests in TIME period you seek without destroying the integrity of the data."

I totally agree.

Can anyone clarify how to specify the time period. Mine has always just displayed the TOTAL requests of any track requested in the past 30 days. Not the requests in the past 30 days. So a track that received 100 requests 2 years ago, can be pushed back to number 1 by just one request within the 30 days.

Can someone direct me to the files that need re-coded and if possible the code needed.


Top
 Profile  
 
 Post subject: Re: reset top ten list
PostPosted: September 28th, 2022, 12:15 am 
Offline
Junior User
Junior User

Joined: April 27th, 2020, 6:15 pm
Posts: 44
The request table will keep track of 3 states (played, ignored, pending). Do check that table, i've had erroneous request hang in pending state for no apparent reason. Also, the request table takes the code returned - filter for requests that have a code of 200 and played as reqstatus. Not all your request counts will be of those values. A song can be requested 400 times, but only return a 200 code the 1st time, as it doesn't violate your playlist rules.
Sort your requestlist by songID, then by code = 200, then by status = played, then t_stamp < date1 and > date2. That will give you as close to what you are looking for as i can think of. then take the top X number of rows and output the songIDs. You can easily do a fetch to songlist where songID = songID.

You could capture the 200 response of a successful request and send it to a mongoDB server that only holds songIDS, numeric value and timestamp, then do a simple descending sort on request count with today - 30 days on timestamp values.


Top
 Profile  
 
Display posts from previous:  Sort by  
 [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group