module MrVideo class EpisodesController < MrVideoController def show cassette = Cassette.find(params[:cassette_id]) episode = cassette.find_episode_by_id(params[:id]) episode_content = episode.content unless params[:fix_relative_links] == 'false' episode_content.gsub!(/href="\//, "href=\"#{episode.website_url}/") episode_content.gsub!(/href="(?[a-zA-z0-9_])/, 'href="' + episode.website_url + '/\k') episode_content.gsub!(/src="\//, "src=\"#{episode.website_url}/") episode_content.gsub!(/@import url\("/, "@import url(\"#{episode.website_url}/") end # TODO: Add method for sending decompressed content send_data episode_content, type: episode.content_type, disposition: 'inline' end def destroy cassette = Cassette.find(params[:cassette_id]) @episode = cassette.find_episode_by_id(params[:id]) @episode.destroy end end # CassettesController class end # MrVideo module