Closed jefferya closed 3 years ago
The first test, edit structure
appears to be related to the caption original name (not the contents of the caption). ToDo 2021-05-21 test & verification needed. This filename contain problematic right quote character: 4-1-Synthese-et-evaluation-de-l’information (1).srt
. One option to fix:
a = MasterFile.find('media_file_id')
a.captions.content = '' # fix filename error, need to remove content & change filename metadata otherwise save doesn't update
a.captions.original_name = 'a.srt'
a.save
The problematic caption: https://era-av.library.ualberta.ca/master_files/k06988552/captions
The second, json, error appears to be in captions
attached to Masterfiles.
Steps to reproduce
z = MediaObject.find('mk61rj10w');
y = z.as_json;
y.to_json # Encoding::UndefinedConversionError ("\xEF" from ASCII-8BIT to UTF-8)
y[:files][0][:captions].to_json # Encoding::UndefinedConversionError ("\xEF" from ASCII-8BIT to UTF-8)
y[:files][0].to_json(:except => :captions) # succeeds
y.to_json(:except => :captions) # succeeds
To download caption files https://era-av.library.ualberta.ca/master_files/${ID}/captions
Fixed the filename problem with the aforementioned approach.
The JSON representation of the media object fails if the caption file contains a byte-order mark or non UTF-8 characters. E.G., path=/media_objects/mk61rj10w.json
Fixed the filename problem with the aforementioned approach.
The JSON representation of the media object fails if the caption file contains a byte-order mark or non UTF-8 characters. E.G., path=/media_objects/mk61rj10w.json. Unused except by transition; will address in #753
HTTP 500 error https://era-av.library.ualberta.ca/media_objects/mk61rj10w/edit?step=structure
Also, a second test: https://era-av.library.ualberta.ca/media_objects/mk61rj10w.json