From d8af196c1593d631aeda892534ebf499fdda0fa7 Mon Sep 17 00:00:00 2001 From: marwoodandrew Date: Fri, 26 Apr 2024 16:34:34 +1000 Subject: [PATCH] fix AAP Image modification date is now rubbish --- server/aap_mm/aap_mm_datalayer.py | 2 +- server/features/aap_mm.feature | 2 +- server/features/sms_report.feature | 22 +++++++++++----------- server/settings.py | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/server/aap_mm/aap_mm_datalayer.py b/server/aap_mm/aap_mm_datalayer.py index cad6e5a45..037a10024 100644 --- a/server/aap_mm/aap_mm_datalayer.py +++ b/server/aap_mm/aap_mm_datalayer.py @@ -194,7 +194,7 @@ def _parse_doc(self, doc): new_doc['original_source'] = doc['Credit'] + '/' + str(doc.get('Source', '')) else: new_doc['original_source'] = doc['Credit'] - new_doc['versioncreated'] = self._datetime(doc['ModifiedDate']) + new_doc['versioncreated'] = self._datetime(doc['CreationDate']) new_doc['firstcreated'] = self._datetime(doc['CreationDate']) new_doc['pubstatus'] = 'usable' # This must match the action diff --git a/server/features/aap_mm.feature b/server/features/aap_mm.feature index 070ff80da..2302dfbe0 100644 --- a/server/features/aap_mm.feature +++ b/server/features/aap_mm.feature @@ -100,7 +100,7 @@ Feature: AAP Multimedia Feature "operation": "fetch", "sign_off": "abc", "byline": "Julian Smith/AAP PHOTOS", - "firstcreated": "2015-03-29T08:49:44+0000" + "firstcreated": "2015-03-29T11:42:29+0000" } ]} """ diff --git a/server/features/sms_report.feature b/server/features/sms_report.feature index c14ecbf0a..10455532f 100644 --- a/server/features/sms_report.feature +++ b/server/features/sms_report.feature @@ -21,7 +21,7 @@ Feature: SMS Report Then we get list with 1 items """ {"_items": [{ - "start_epoch": 1530226800000, + "start_epoch": 1530223200000, "interval": 86400000, "with_sms": [0, 1, 1], "without_sms": [1, 1, 0] @@ -71,14 +71,14 @@ Feature: SMS Report "type": "column", "xAxis": 0, "data": [0, 1, 1], - "pointStart": 1530226800000, + "pointStart": 1530223200000, "pointInterval": 86400000 }, { "name": "Without SMS", "type": "column", "xAxis": 0, "data": [1, 1, 0], - "pointStart": 1530226800000, + "pointStart": 1530223200000, "pointInterval": 86400000 }] }] @@ -106,7 +106,7 @@ Feature: SMS Report Then we get list with 1 items """ {"_items": [{ - "start_epoch": 1530313200000, + "start_epoch": 1530309600000, "interval": 3600000, "with_sms": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], "without_sms": [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] @@ -155,15 +155,15 @@ Feature: SMS Report "name": "With SMS", "type": "column", "xAxis": 0, - "data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], - "pointStart": 1530313200000, + "data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + "pointStart": 1530309600000, "pointInterval": 3600000 }, { "name": "Without SMS", "type": "column", "xAxis": 0, - "data": [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - "pointStart": 1530313200000, + "data": [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "pointStart": 1530309600000, "pointInterval": 3600000 }] }] @@ -194,7 +194,7 @@ Feature: SMS Report Then we get list with 1 items """ {"_items": [{ - "start_epoch": 1529190000000, + "start_epoch": 1529186400000, "interval": 604800000, "with_sms": [1, 2], "without_sms": [1, 1] @@ -247,14 +247,14 @@ Feature: SMS Report "type": "column", "xAxis": 0, "data": [1, 2], - "pointStart": 1529190000000, + "pointStart": 1529186400000, "pointInterval": 604800000 }, { "name": "Without SMS", "type": "column", "xAxis": 0, "data": [1, 1], - "pointStart": 1529190000000, + "pointStart": 1529186400000, "pointInterval": 604800000 }] }] diff --git a/server/settings.py b/server/settings.py index 0bb558515..0c7143844 100644 --- a/server/settings.py +++ b/server/settings.py @@ -149,7 +149,7 @@ def env(variable, fallback_value=None): AAP_MM_SEARCH_MEDIA_TYPES = ['image'] # The URL endpoint for the images API -AAP_MM_SEARCH_URL = env('AAP_MM_SEARCH_URL', 'https://photos-api.aap.com.au/api/v3') +AAP_MM_SEARCH_URL = env('AAP_MM_SEARCH_URL', 'https://photos-api-prod.aap.com.au/api/v3') # Partial URL for the video preview AAP_MM_CDN_URL = env('AAP_MM_CDN_URL', 'https://photos-cdn.aap.com.au/Preview.mp4') @@ -339,7 +339,7 @@ def env(variable, fallback_value=None): DC_URL = env('DC_URL', '') DC_USERNAME = env('DC_USERNAME', '') DC_PASSWORD = env('DC_PASSWORD', '') -DC_SEARCH_FIELD = env('DC_SEARCH_FIELD', 'ORIGINALTRANSMISSIONREFERENCE') +DC_SEARCH_FIELD = env('DC_SEARCH_FIELD', 'OriginalTransmissionReference') PLANNING_ACCEPT_ASSIGNMENT_EMAIL = env('PLANNING_ACCEPT_ASSIGNMENT_EMAIL', _MAIL_FROM) EMBED_PRODUCT_FILTERING = strtobool(env('EMBED_PRODUCT_FILTERING', 'true'))