diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 13f2312a1..815be7525 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -91,27 +91,6 @@ class Application_Model_StoredFile { } else { $dbMd = array(); - - if (isset($p_md["MDATA_KEY_YEAR"])){ - // We need to make sure to clean this value before inserting into database. - // If value is outside of range [-2^31, 2^31-1] then postgresl will throw error - // when trying to retrieve this value. We could make sure number is within these bounds, - // but simplest is to do substring to 4 digits (both values are garbage, but at least our - // new garbage value won't cause errors). If the value is 2012-01-01, then substring to - // 4 digits is an OK result. - // CC-3771 - - $year = $p_md["MDATA_KEY_YEAR"]; - - if (strlen($year) > 4){ - $year = substr($year, 0, 4); - } - if (!is_numeric($year)){ - $year = 0; - } - $p_md["MDATA_KEY_YEAR"] = $year; - } - foreach ($p_md as $mdConst => $mdValue) { $dbMd[constant($mdConst)] = $mdValue; } diff --git a/python_apps/media-monitor/airtimefilemonitor/airtimemetadata.py b/python_apps/media-monitor/airtimefilemonitor/airtimemetadata.py index 59bbc784e..92ffa4eca 100644 --- a/python_apps/media-monitor/airtimefilemonitor/airtimemetadata.py +++ b/python_apps/media-monitor/airtimefilemonitor/airtimemetadata.py @@ -198,7 +198,7 @@ class AirtimeMetadata: md['MDATA_KEY_CONDUCTOR'] = self.truncate_to_length(md['MDATA_KEY_CONDUCTOR'], 512) if 'MDATA_KEY_YEAR' in md: - md['MDATA_KEY_YEAR'] = self.truncate_to_length(md['MDATA_KEY_YEAR'], 16) + md['MDATA_KEY_YEAR'] = self.truncate_to_length(md['MDATA_KEY_YEAR'], 4) if 'MDATA_KEY_URL' in md: md['MDATA_KEY_URL'] = self.truncate_to_length(md['MDATA_KEY_URL'], 512)