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

@ -2,6 +2,19 @@ class Channel < Sequel::Model
one_to_many :videos
def ensureDirectoryStructure()
sub_dirs = ['Archive', 'Channel Documents', 'Main', 'Shorts']
sub_dirs.each do |d|
sub_path = File.join(
@values[:directory_path],
d
)
unless Dir.exist?(sub_path)
Dir.mkdir(sub_path)
end
end
end
def openProjects()
return 0
end

View File

@ -4,6 +4,19 @@ class Video < Sequel::Model
many_to_one :channel
def ensureDirectoryStructure()
sub_dirs = ['Audio', 'B-Roll', 'Clips', 'Images', 'Export']
sub_dirs.each do |d|
sub_path = File.join(
@values[:directory_path],
d
)
unless Dir.exist?(sub_path)
Dir.mkdir(sub_path)
end
end
end
def parseScript()
return Kramdown::Document.new(@values[:script]).to_html
end