diff --git a/botthread.c b/botthread.c index 9e3043f..7b8e8b7 100644 --- a/botthread.c +++ b/botthread.c @@ -451,7 +451,7 @@ /* Find A Random Song */ getRandom: if (tmpChans->modes[CHAN_RANDOM] == 0x1) { - sprintf(output,"SELECT artist,title,file,length,vid,classification,rating FROM videos WHERE rating <= %i",tmpChans->modes[CHAN_RATING]); + sprintf(output,"SELECT artist,title,file,length,vid,classification,rating,count FROM videos WHERE rating <= %i",tmpChans->modes[CHAN_RATING]); if (tmpChans->modes[CHAN_EXCLUSIVE]) sprintf(output,"%s AND oid = %i",output,tmpChans->modes[CHAN_EXCLUSIVE]); if (tmpChans->modes[CHAN_CLASS]) @@ -483,7 +483,7 @@ tmpChans->comDelay = COM_DELAY; getComAgain: - sprintf(output,"SELECT artist,title,file,length,vid,classification,rating FROM videos WHERE rating <= %i AND classification = 7 AND count <= %i",tmpChans->modes[CHAN_RATING],playCnt); + sprintf(output,"SELECT artist,title,file,length,vid,classification,rating,count FROM videos WHERE rating <= %i AND classification = 7 AND count <= %i",tmpChans->modes[CHAN_RATING],playCnt); res = dbQuery(output,1); if (res == 0x0) { @@ -498,7 +498,7 @@ tuveSendAllInChan(tmpChans->channel,0x0,output); } else { - mysql_data_seek(res,(random() % mysql_num_rows(res))); + mysql_data_seek(res,0); row = mysql_fetch_row(res); sprintf(output,"UPDATE videos SET count = %i WHERE vid = %s\n",atoi(row[7])+1,row[4]); dbQuery(output,0);