<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Skermstafir.Models;
using Skermstafir.Repositories;

namespace Skermstafir.Controllers
{
    public class SearchController : Controller
    {
        //
        // GET: /Search/
		// FormData PARAMETER
        public ActionResult Search()
        {
            SubtitleModelList result = new SubtitleModelList();
  			SearchRepository sc = new SearchRepository();

			result = sc.GetSubtitleByNewest(0, 5);

			return View("Subtitles", result);
        }
	}
}<commit_msg>Damn I'm good<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Skermstafir.Models;
using Skermstafir.Repositories;

namespace Skermstafir.Controllers
{
    public class SearchController : Controller
    {
        //
        // GET: /Search/
		// FormData PARAMETER
        public ActionResult Search(FormCollection form)
        {
            SubtitleModelList result = new SubtitleModelList();
  			SearchRepository sc = new SearchRepository();
			List<Subtitle> stringResult = sc.GetSubtitleByString(form["SearchValue"]).modelList;

			int start, end;
			if (form["StartYear"] != "") {
				start = Convert.ToInt32(form["StartYear"]);
			} else {
				start = 0;
			}
			if (form["EndYear"] != "") {
				end = Convert.ToInt32(form["EndYear"]);
			} else {
				end = 0;
			}
			List<Subtitle> genreResult = new List<Subtitle>();
			if (form["Kvikmyndir"] == "on") {
				genreResult = genreResult.Union(sc.GetSubtitleByGenre("Kvikmyndir").modelList).ToList();
			}
			if (form["Þættir"] == "on") {
				genreResult = genreResult.Union(sc.GetSubtitleByGenre("Þættir").modelList).ToList();
			}
			if (form["Barnaefni"] == "on") {
				genreResult = genreResult.Union(sc.GetSubtitleByGenre("Barnaefni").modelList).ToList();
			}
			if (form["Heimildir"] == "on") {
				genreResult = genreResult.Union(sc.GetSubtitleByGenre("Heimildir").modelList).ToList();
			}
			if (form["Gaman"] == "on") {
				genreResult = genreResult.Union(sc.GetSubtitleByGenre("Gaman").modelList).ToList();
			}
			if (form["Spenna"] == "on") {
				genreResult = genreResult.Union(sc.GetSubtitleByGenre("Spenna").modelList).ToList();
			}
			if (form["Drama"] == "on") {
				genreResult = genreResult.Union(sc.GetSubtitleByGenre("Drama").modelList).ToList();
			}
			if (form["Ævintýri"] == "on") {
				genreResult = genreResult.Union(sc.GetSubtitleByGenre("Ævintýri").modelList).ToList();
			}
			result.modelList = stringResult.Union(genreResult).ToList();
			result.modelList = (from item in result.modelList
								where item.YearCreated >= start && item.YearCreated <= end
								select item).ToList();
			return View(result);
        }
	}
}
{'fraction_non_alphanumeric': 0.1481216457960644, 'fraction_numerical': 0.0028622540250447226, 'mean_word_length': 3.5686274509803924, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2755437', 'n_tokens_mistral': 1049, 'n_tokens_neox': 937, 'n_words': 159}