"""Logic for asset file details.""" from owsresponse import response from asset_file_details.constants import error from asset_file_details.models import file_details as \ file_details_model def get_file_details_by_format(file_format, upc, physical_location_id=1): """Get the details for the flac|wav file and put in a dictionary. Args: file_format (str): File format. upc (str): UPC of the asset. physical_location_id (str): ID of physical location storage Returns: Response: Dictionary containing asset file details. """ result_rows = file_details_model.get_file_details_by_format( file_format, upc, physical_location_id) if result_rows: return response.Response(result_rows) return response.Response({'message': error.ERROR_MESSAGE_NOT_ASSET_FOUND})