stage-manager/app/models/channel.rb

23 lines
467 B
Ruby
Raw Normal View History

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()
2023-03-07 11:54:20 -05:00
return self.videos_dataset.exclude(status: 'published').exclude(archived: true).all()
end
end