Author Topic: LAST PLAYED  (Read 199 times)

manishboyradio

  • Full Member

  • Offline
  • ***
  • 134
LAST PLAYED
« on: January 04, 2019, 10:07:14 PM »
is there anyway to make radio dj create a last played text file as it is playing live?, so it updates a text file with the most recent songs played?

plauri

  • Hero Member

  • Offline
  • *****
  • 1110
    • Funky Corner Radio
Re: LAST PLAYED
« Reply #1 on: January 05, 2019, 12:34:00 AM »
It's what the program does since the early versions. Just say to your encoder to look into your NowPlaying.txt which should be located in radiodj directory. 
Funky Corner Radio
http://www.funkycorner.it
http://www.radiofunkycorner.com

manishboyradio

  • Full Member

  • Offline
  • ***
  • 134
Re: LAST PLAYED
« Reply #2 on: January 05, 2019, 01:45:46 AM »
I am talking about files that have played, not currently playing which is what the now playing text file is. I want a text file as radio dj is playing to create record of what has played, no currently playing

plauri

  • Hero Member

  • Offline
  • *****
  • 1110
    • Funky Corner Radio
Re: LAST PLAYED
« Reply #3 on: January 05, 2019, 02:45:18 AM »
Look at Jhonny site, he has scripts that can make it https://radiodj.info/
Funky Corner Radio
http://www.funkycorner.it
http://www.radiofunkycorner.com

Jhonny

  • Hero Member

  • Offline
  • *****
  • 3297
  • Personal Text
    Peace, enjoy life.it's over before you've lived it
    • Jhonny's RadioDJ tutorials.
Re: LAST PLAYED
« Reply #4 on: January 05, 2019, 10:37:09 AM »
You can use reports to make a txt file.
With this template file - General - Last Played Tracks on date.html.
Put it in the c:\RadioDJv2\templates\reports\ folder.
Only tested on last 5 days.
R.T.F.M. means to me, Read The Fantastic Messages.
Make things simple, but don't make simple things simpler!
I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit https://radiodj.info

Testing v.2.0.1.5 beta

manishboyradio

  • Full Member

  • Offline
  • ***
  • 134
Re: LAST PLAYED
« Reply #5 on: January 12, 2019, 01:49:38 AM »
Is there anyway to setup a query to run within radio dj to generate a file that shows what has played within the last 20 min?

stinga

  • Full Member

  • Offline
  • ***
  • 218
    • CoastFM
Re: LAST PLAYED
« Reply #6 on: January 13, 2019, 10:50:49 AM »
Yes. You want to query the history table
Helps run CoastFM in Penzance UK
Running 4 x 1.8.2.0
mariaDB and tracks on a central server.

manishboyradio

  • Full Member

  • Offline
  • ***
  • 134
Re: LAST PLAYED
« Reply #7 on: January 13, 2019, 04:37:53 PM »
I am sorry but i am not familiar with all the scripting for that, what would be the query string i would need to run to get the last, lets say 15 tracks played. Then put that into a text file or a html file?

Thanks in advance

Calypso

  • Full Member

  • Offline
  • ***
  • 249
Re: LAST PLAYED
« Reply #8 on: January 14, 2019, 08:33:30 AM »
I am sorry but i am not familiar with all the scripting for that, what would be the query string i would need to run to get the last, lets say 15 tracks played. Then put that into a text file or a html file?

Thanks in advance

You could use a query like

Quote
select date_played,artist, title from history where date_played>date_sub(now(), interval 15 minute);


manishboyradio

  • Full Member

  • Offline
  • ***
  • 134
Re: LAST PLAYED
« Reply #9 on: January 14, 2019, 06:11:14 PM »
Could you please give a full example? with the query creating a text or html file, Again i appreciate your help

Thanks,
Andrew

stinga

  • Full Member

  • Offline
  • ***
  • 218
    • CoastFM
Re: LAST PLAYED
« Reply #10 on: January 14, 2019, 06:29:32 PM »
Select to get last 60 minutes.
Code: [Select]
select date_played,duration,artist,title from history where date_played between now() - interval 60 minute and now()
Ours actually looks like...

Code: [Select]
select date_played,duration,artist,title, left(user,instr(user, '@') - 1) 'user' from history where date_played between now() - interval 60 minute and now()
We have user to distinguish between the 4 studios.

Code: [Select]
nostromo Mon Jan 14 17:18:04 2019 [radiodj]: select date_played,duration,artist,title, left(user,instr(user, '@') - 1) 'user' from history where date_played between now() - interval 6 minute and now();
+---------------------+-----------+---------------------------+-----------------------------------------------+--------+
| date_played         | duration  | artist                    | title                                         | user   |
+---------------------+-----------+---------------------------+-----------------------------------------------+--------+
| 2019-01-14 17:12:43 | 263.48655 | MATTHEWS SOUTHERN COMFORT | Woodstock                                     | txb    |
| 2019-01-14 17:14:00 | 198.73463 | Danny L Harle             | Broken Flowers                                | txa    |
| 2019-01-14 17:14:01 |  14.51957 | PLACES ID                 | MARAZION MORVAH MOUSEHOLE Elasticity          | tx3_ss |
| 2019-01-14 17:14:15 |  11.90730 | Unknown Artist            | C&B shotgun COAST AUTOMATION IDENT A          | tx3_ss |
| 2019-01-14 17:14:24 |  29.51810 | Adamatic                  | ad_to_play                                    | tx3_ss |
| 2019-01-14 17:14:52 | 198.73463 | Danny L Harle             | Broken Flowers                                | tx3_ss |
| 2019-01-14 17:17:06 |   9.00313 | Unknown Artist            | Free Fall shotgun COAST AUTOMATION IDENT E    | txb    |
| 2019-01-14 17:17:12 |  29.51810 | Adamatic                  | ad_to_play                                    | txb    |
| 2019-01-14 17:17:17 |   8.96195 | Unknown Artist            | F Disco shotgun COAST AUTOMATION IDENT D      | txa    |
| 2019-01-14 17:17:23 |  29.51810 | Adamatic                  | ad_to_play                                    | txa    |
| 2019-01-14 17:17:40 |  12.83141 | PLACES ID                 | COCKWELLS CRIPPLESEASE CROWLAS Waterfall      | txb    |
| 2019-01-14 17:17:51 |  12.96401 | PLACES ID                 | BADGERS CROSS DRIFT CARBIS BAY Crash and Burn | txa    |
| 2019-01-14 17:17:53 | 184.06324 | Galantis                  | No Money                                      | txb    |
| 2019-01-14 17:18:03 | 162.45755 | Four Tops                 | It's the Same Old Song                        | txa    |
| 2019-01-14 17:18:09 | 162.45755 | Four Tops                 | It's the Same Old Song                        | tx3_ss |
+---------------------+-----------+---------------------------+-----------------------------------------------+--------+
There probably should be an order by in there somewhere.
Helps run CoastFM in Penzance UK
Running 4 x 1.8.2.0
mariaDB and tracks on a central server.

manishboyradio

  • Full Member

  • Offline
  • ***
  • 134
Re: LAST PLAYED
« Reply #11 on: January 14, 2019, 06:55:31 PM »
Awesome, this helps a bunch, i am looking to use this to integrate this into my twitch stream, so that OBS streaming software reads that text file generated to show what had played recently. unless you know of another way to have OBS streaming software to read last played information from Radio DJ. or integrate into twitch

Thanks again

stinga

  • Full Member

  • Offline
  • ***
  • 218
    • CoastFM
Re: LAST PLAYED
« Reply #12 on: January 14, 2019, 10:28:05 PM »
As noted above, RDJ notifies in various ways what the last played track is so if that is only what you need then the query is unnecessary, if you want the last x tracks then the query is the way to go unless your app keeps track of what has played.
Helps run CoastFM in Penzance UK
Running 4 x 1.8.2.0
mariaDB and tracks on a central server.