Commit dfe507d4 authored by Stan Hu's avatar Stan Hu

Fix chat and transcript logs

By default, the google_drive gem converts the files to Google Docs,
which causes the .txt extension to be dropped.
parent 107e28ff
......@@ -180,7 +180,9 @@ class GoogleDriveClient
end
begin
uploaded = dest_folder.upload_from_file(filename)
# Google Drive will convert a .txt to a Google Docs file and strip
# the extension, which makes it hard to check for dupliates.
uploaded = dest_folder.upload_from_file(filename, nil, convert: false)
rescue Google::Apis::ServerError => e
puts "Google API error: #{e}"
return false
......@@ -322,7 +324,10 @@ class ZoomSyncher
# Discard any audio or videos that aren't longer than 30 seconds
def should_upload?(filename, file_type)
return true if file_type.downcase == 'chat'
file_type = file_type.downcase
return true if %w[chat transcript].include?(file_type)
return false if file_type == 'timeline'
duration = MediaInfo.from(filename)&.audio&.duration
......@@ -361,6 +366,7 @@ class ZoomSyncher
file_type = file_type.downcase
return 'txt' if file_type == 'chat'
return 'transcript.txt' if file_type == 'transcript'
file_type
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment