• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

Need a different type of report template to calculate fees for using music

Started by Olav, February 01, 2019, 09:08:46 PM

Olav

Hi!

We are a radiostation using RDJ and really loves it.
A new development this year is that we have to send a special formated report regarding the music we use.

The inbuild system is not giving me what I need, but using some php / mysql access, I have found what I need.

However, the is one unresolved issue.
In the history table, the duration field is of type "double(11,5)" and not in any format I can calculate back to mm:ss.

How can I do that?

Marius

The duration stored in the database is in seconds, so you can calculate it easily.  :)
PS: you can take a look to the existing templates, they are SQL queries based, you can find them in: "C:\RadioDJv2\templates\reports"
To transform the seconds to hours, minutes and seconds, you can use the following MySQL SEC_TO_TIME() function as follows:
SELECT SEC_TO_TIME(ROUND(duration)) As 'Duration' from songs WHERE ID=x;
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

Olav

It almost seems to easy when you put it that way :-)
Thank you for the help!

I figured that our report format would be to old-fashion to put i a software of this millenium.
They need a .txt file with one song pr line and specific amount of character positions pr field.
If this would have been done with a .csv, I would have asked to just add the "songID" field to the reports.

I am now just writing out every instance to a .txt file in a while loop alowing me to just add the need extra "spaces" to every field / line.

Again, thanks a lot for all the effort!