<commit_before>package scareflix

import groovy.json.*

class SearchController {

    def index() {
        def baseUrl = "http://localhost:8001/movies/"
        def foundResults = false
        def resultsList

        // Get the search term
        def title = params.title
        def actor = params.actor

        // Perform the search
        if (title != null || actor != null) {
            def feedUrl

            // Construct the API request URL.
            if (title != null) {
                feedUrl = baseUrl + "title/" + title
            } else {
                feedUrl = baseUrl + "actor/" + actor
            }

            // Run the query and process its results
            def text = ("curl " + feedUrl).execute().text
            if (!text.equals("")) {
                resultsList = new JsonSlurper().parseText(text)
                foundResults = true
            }
        }

        [foundResults:foundResults, resultsList:resultsList]
    }
}<commit_msg>Fix how empty results are handled<commit_after>package scareflix

import groovy.json.*

class SearchController {

    def index() {
        def baseUrl = "http://localhost:8001/movies/"
        def foundResults = false
        def resultsList

        // Get the search term
        def title = params.title
        def actor = params.actor

        // Perform the search
        if (title != null || actor != null) {
            def feedUrl

            // Construct the API request URL.
            if (title != null) {
                feedUrl = baseUrl + "title/" + title
            } else {
                feedUrl = baseUrl + "actor/" + actor
            }

            // Run the query and process its results
            def text = ("curl " + feedUrl).execute().text
            if (!text.equals("")) {
                resultsList = new JsonSlurper().parseText(text)

                // Check if there were any results
                if (resultsList.size() > 0) {
                    foundResults = true
                }
            }
        }

        [foundResults:foundResults, resultsList:resultsList]
    }
}
{'fraction_non_alphanumeric': 0.0967741935483871, 'fraction_numerical': 0.004269449715370019, 'mean_word_length': 1.4213547646383466, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7317530', 'n_tokens_mistral': 552, 'n_tokens_neox': 515, 'n_words': 160}