* Added '--bitrate=', '--channels=', '--format=', '--quality='
and '--samplerate=' to rdexport(1) in 'utils/rdexport/rdexport.cpp'
and 'utils/rdexport/rdexport.h'.
Most files are simple swaps to get rid of extra " as a NULL return will give
invalid SQL if used as follows UPDATE x SET y="NULL";
See github issue 121 for more info.
Extra changes have been made to the following files:
* lib/rdcartslot.cpp
- Added a QDateTime variable to prevent EVENT_DATETIME becoming
"2016-06-09" "NULL" as it was checked separately for date and time
* lib/rdcut.cpp
- Reworked START_DATETIME and END_DATETIME to save the SQL ifs. I believe this
makes it easier to read and understand.
- The >QDate(1900,1,1) and < 8000 is probably not needed but I left it there
just in case.
* lib/rdescape_string.cpp
- Reworked to add extra " if the date is not NULL see issue 121
* lib/rdfeed.cpp && lib/rdpodcast.cpp
- Had to add a SetRow for QDateTime as with the string conversion the existing
SetRow would add an extra set of "
* lib/rdsound_panel.cpp && rdairplay/log_traffic.cpp
&& utils/rddgimport/rddgimport.cpp
- Added a QString to contain EVENT_DATETIME to prevent double checks of date
and time separately (similar to lib/rdcartslot.cpp)
* rdcatchd/rdcatchd.cpp
- Reverted the changes. The RML here is not touching the DB so is fine, plus
with the RDCheckDateTime changes you'd have extra " unless it was NULL
* tests/sas_switch_torture.cpp && sas_torture.cpp
- Included missing rdescape_string.h
* Added code in 'lib/rdevent_line.cpp' and 'lib/rdsvc.cpp' to allow
embedded traffic breaks to be specified with start time and length
in the music schedule.
Unsure if the times can be invalid but old MySQL values can have 0000-00-00 as
dates but the 5.7+ can't. There is a null check for this but I'm not 100% sure
whether 0000-00-00 passes the isNull. Put in a date check for both just in
case.
Changed purge_date to a QString so that it can be checked with the normal
RDCheckDateTime function. Also means the QString.isEmpty check is a straight
forward QDate.isValid and in that case we can use QDate.toString rather than
formatting via RDCheckDateTime (and incurring another QDate.isValid check).
Checking is probably not needed and even if it did find an invalid date it would
likely not return valid SQL e.g this is just one paraphrased example from the
code:
SELECT x FROM y WHERE EVENT_DATETIME<="NULL 00:00:00"
I've reverted back the two select changes for the daypart code and put a TODO
note there as a marker.
This doesn't use a dedicated setRow, instead it converts to QString and then
tries to insert the dates instead.
Amended setOrigin and setEffectiveDateTime to use RDCheckDateTime
With MySQL v5.7+ you have to specifically set either a valid date or NULL
otherwise you get SQL errors. In previous versions setting a date to "" implied
NULL, this is no longer the case which causes nice SQL errors all over the
place.
This new RDCheckDateTime is an overloaded function that calls the respective
isValid method of QDate/Time/DateTime and either returns the requested formatted
string or returns NULL as a string.
This can then be used as part of an INSERT/UPDATE without breaking the stricter
NULL interpretation of MySQL v5.7+.
* Modified the Edit Log screen in 'rdlogedit/edit_log.cpp' to
display the link Start Time and Length for Traffic and Music links
in the 'EXT DATA' column.
* Removed display of the link Length for Traffic and Music links
from the LENGTH column in 'rdlogedit/edit_log.cpp'.
* Added 'RDAudioExport::cartNumber()', 'RDAudioExport::cutNumber()'
and 'RDAudioExport::settings()' meethods in 'lib/rdaudioexport.cpp'
and 'lib/rdaudioexport.h'.
* Added expanded error logging in 'utils/rdexport/rdexport.cpp'.
* Documented the '--allow-clobber' switch in
'docs/docbook/rdexport.xml'.
* Documented the '--continue-after-error' switch in
'docs/docbook/rdexport.xml'.