stage-manager/app/models/channel.rb

23 lines
467 B
Ruby

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 self.videos_dataset.exclude(status: 'published').exclude(archived: true).all()
end
end