2023-03-03 13:05:01 -05:00
|
|
|
class Channel < Sequel::Model
|
|
|
|
|
|
|
|
one_to_many :videos
|
|
|
|
|
2023-03-06 15:59:09 -05:00
|
|
|
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
|
|
|
|
|
2023-03-03 14:19:20 -05:00
|
|
|
def openProjects()
|
2023-03-07 11:54:20 -05:00
|
|
|
return self.videos_dataset.exclude(status: 'published').exclude(archived: true).all()
|
2023-03-03 14:19:20 -05:00
|
|
|
end
|
|
|
|
|
2023-03-03 13:05:01 -05:00
|
|
|
end
|