Forum Activity for @popradio-stockholm

kissntel
@popradio-stockholm
06/15/23 09:48:18AM
12 posts

update stream count by 1 seem impossible


Jamroom Developers

Hi, oh, that was the original code and I forgot to change back. but somehow that doesn't work either.
I got a feeling it wont connect properly, remembered I saw some error said " cant find the column audio_file_stream_count. as I changed around.
I really dont now how to debug and see what is going on.
I noticed the Module jrShoutcastPlayer where the code is in is not registered as other modules are. Status is just an ? instead of a green spot. May that cause som issue to not work along with the Audio module?? Also I cant run system check since I bought this ShoutCast module. I could really be great if it works..
Thanks // Jacob
kissntel
@popradio-stockholm
06/15/23 08:00:42AM
12 posts

update stream count by 1 seem impossible


Jamroom Developers

I have a Shoutcast live stream and wants to update the audio_file_stream_count with 1 everytime a song is played.
I can get the audio_title and audio_artist out of the stream but tried so hard to update the
JrAudio database. I manually upload files with audio_title and audio_artist and_item_id a s o.
When playing those song on demand the it adds a play in the count, but not when in live stream.
The code that should do the job is this:
// Get all audio files that are part of this album
    $_sp = array(
    'search'                       => array(
      
	 
	   "audio_title = {$_post['song']}",
	 
     "audio_artist = {$_post['profile_name']}",

	     ),
    'return_keys'                  => array('_item_id'),
    'exclude_jrUser_keys'          => true,
    'exclude_jrProfile_quota_keys' => true,
    'order_by'                     => array('_created' => 'numerical_asc'),
    'limit'                        => 1
);

 $_rt = jrCore_db_search_items('jrAudio', $_sp);

    if (isset($_rt) && is_array($_rt)) {
   
 jrCore_db_increment_key('jrAudio',$_rt['_items'][0]['item_id'], 'audio_file_stream_count',1,true);
        return jrCore_json_response(array('success' => 1));
 }
   // return jrCore_json_response(array('error' => 'update failed'));
}
the code passed by without any error messages but nothing changes i the database?
What Am I missing?
Please, thank you. // Jacob
updated by @popradio-stockholm: 09/27/23 02:49:12AM
  2