Added functionality to create directory structure for channels and videos

This commit is contained in:
2023-03-06 15:59:09 -05:00
parent a2f2224b96
commit f243452783
6 changed files with 34 additions and 2 deletions

View File

@ -24,7 +24,9 @@ namespace '/channel' do
description: params[:channel_description]
)
# create supporting directory structure
Dir.mkdir(channel.directory_path)
channel.ensureDirectoryStructure()
redirect "/channel/#{channel.id}"
end

View File

@ -25,6 +25,7 @@ namespace '/video' do
video_serial = params[:video_serial].to_s.rjust(4, '0')
video_path = File.join(
channel.directory_path,
'Main',
"##{video_serial} - #{params[:video_name]}"
)
@ -37,7 +38,9 @@ namespace '/video' do
script: "# Introduction\n\n# Body\n\n# Conclusions"
)
# create supporting directory structure
Dir.mkdir(video_path)
video.ensureDirectoryStructure()
redirect "/video/#{video.id}"
end
@ -72,6 +75,7 @@ namespace '/video' do
video_serial = params[:video_serial].to_s.rjust(4, '0')
video_path = File.join(
channel.directory_path,
'Main',
"##{video_serial} - #{params[:video_name]}"
)