diff --git a/config/config.yaml b/config/config.yaml index 797f6b2..fa0c423 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -41,12 +41,6 @@ mediainfo_values: Sampling rate: 48.0 kHz Bit depth: 24 bits Compression mode: Lossless - expected_custom_fields: - Title: - Encoded by: - Description: - Encoding settings: - ORIGINAL MEDIA TYPE: exiftool_values: File Type: MKV File Type Extension: mkv @@ -140,10 +134,18 @@ ffmpeg_values: ORIGINAL MEDIA TYPE: ENCODED_BY: mediatrace: + COLLECTION: TITLE: + CATALOG_NUMBER: DESCRIPTION: - ORIGINAL MEDIA TYPE: + DATE_DIGITIZED: + ENCODING_SETTINGS: ENCODED_BY: + ORIGINAL_MEDIA_TYPE: + DATE_TAGGED: + TERMS_OF_USE: + _TECHNICAL_NOTES: + _ORIGINAL_FPS: qct-parse: content: silence: diff --git a/src/AV_Spex/checks/mediainfo_check.py b/src/AV_Spex/checks/mediainfo_check.py index 173ff40..9fc2462 100644 --- a/src/AV_Spex/checks/mediainfo_check.py +++ b/src/AV_Spex/checks/mediainfo_check.py @@ -13,7 +13,6 @@ def parse_mediainfo(file_path): expected_general = config_path.config_dict['mediainfo_values']['expected_general'] expected_video = config_path.config_dict['mediainfo_values']['expected_video'] expected_audio = config_path.config_dict['mediainfo_values']['expected_audio'] - expected_custom_fields = config_path.config_dict['mediainfo_values']['expected_custom_fields'] section_data = {} # creates empty dictionary "section_data" @@ -114,32 +113,15 @@ def parse_mediainfo(file_path): if actual_value not in expected_value: mediainfo_differences.append(f"Metadata field in Audio: {expected_key} has a value of {actual_value}\nThe expected value is: {expected_value}") # append this string to the list "mediainfo_differences" - - custom_mediainfo_differences = [] - for expected_key, expected_value in expected_custom_fields.items(): - # defines variables "expected_key" and "expected_value" to the dictionary "expected_audio" - if expected_key not in (section_data["General"]): - custom_mediainfo_differences.append(f"metadata field in General: {expected_key} does not exist") - elif len(section_data["General"][expected_key]) == 0: - # count the values in the nested dictionary "General" with 'len', if the values are zero, then: - custom_mediainfo_differences.append(f"General: {expected_key} is empty") - # append this string to the list "mediainfo_differences" - if not mediainfo_differences and not custom_mediainfo_differences: + if not mediainfo_differences: # if the list "mediainfo_differences" is empty, then logger.info("\nAll specified fields and values found in the MediaInfo output.") - elif not mediainfo_differences: - logger.info("\nAll specified metadata fields and values found in the MediaInfo output, but some custom embedded fields are missing or don't match.") else: # if the list "mediainfo_differences" is not empty, then logger.critical(f"\nSome specified MediaInfo fields or values are missing or don't match:") for diff in mediainfo_differences: logger.critical(f'{diff}') - - if custom_mediainfo_differences: - logger.critical("\nThe specified MediaInfo fields or values for embedded metadata are below:") - for custom_diff in custom_mediainfo_differences: - logger.critical(f'{custom_diff}') # Only execute if this file is run directly, not imported) if __name__ == "__main__": diff --git a/src/AV_Spex/checks/mediatrace_check.py b/src/AV_Spex/checks/mediatrace_check.py index 04cd7bf..5a68cfd 100644 --- a/src/AV_Spex/checks/mediatrace_check.py +++ b/src/AV_Spex/checks/mediatrace_check.py @@ -49,6 +49,10 @@ def parse_mediatrace(xml_file): mediatrace_differences.append(f"MediaTrace: {expected_key} is empty") # append this string to the list "mediatrace_differences" + if not mediatrace_differences: + # if the list "mediatrace_differences" is empty, then + logger.info("\nAll specified mediatrace fields and values found in output.") + if mediatrace_differences: logger.critical("\nSome specified MediaTrace fields or values are missing or don't match:") for diff in mediatrace_differences: