Verified Commit dc21eea5 authored by Lukas 'Eipi' Eipert's avatar Lukas 'Eipi' Eipert 🔴
Browse files

Include event date in folder structure

This changes the folder structure from:

    {prefix}-{topic}/

to

    {prefix}-{topic}/{event_date}

This makes it easier to sort a folder and quickly find the recording and
all related files for a given day.
parent dcc2c24f
......@@ -274,7 +274,7 @@ class ZoomSyncher
end
ext = file_extension(file_type)
folder = subfolder(email, topic, file_type)
folder = subfolder(email, topic, event_date, file_type)
filename = sanitize_filename("#{topic}-#{event_date}-#{uuid}-#{index}") + ".#{ext}"
video_url = file['download_url'] + "?access_token=#{client.access_token}"
file_size = file['file_size']
......@@ -370,11 +370,11 @@ class ZoomSyncher
end
end
def subfolder(prefix, topic, file_type)
def subfolder(prefix, topic, event_date, file_type)
base_name = "#{prefix}-#{topic}"
return [base_name, 'audio'] if file_type.casecmp('m4a').zero?
return [base_name, event_date, 'audio'] if file_type.casecmp('m4a').zero?
[base_name]
[base_name, event_date]
end
def file_extension(file_type)
......
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