# -*- encoding : utf-8 -*-
	class Public::VideoFilesController < ApplicationController
	
	
	layout :get_public_layout


  def index
    @video_folders = VideoFolder.publics.all
  end


	def show
		if @video_file_lang = VideoFileLang.where(:slug => params[:slug], :lang_site_id => LangSite.find_by_slug(params[:lang]).id).first
    
    elsif @video_file_lang = VideoFileLang.where(:slug => params[:slug]).first
    end
    @video_file = @video_file_lang.video_file
    if @video_file.public? or current_admin
      
    else
      redirect_to "/"
    end
	
  
  
  end
  
  

end