<commit_before>module Model
    exposing
        ( init
        , getBuildRecordList
        , getNextBuilds
        , updateModelWithFilters
        )

import Decoder exposing (..)
import Filters exposing (..)
import Kinto
import Navigation exposing (..)
import Types exposing (..)
import Url exposing (..)


init : Location -> ( Model, Cmd Msg )
init location =
    let
        defaultModel =
            { buildsPager = Kinto.emptyPager client recordResource
            , filteredBuilds = []
            , filterValues = FilterValues productList channelList platformList versionList localeList
            , productFilter = "all"
            , versionFilter = "all"
            , platformFilter = "all"
            , channelFilter = "all"
            , localeFilter = "all"
            , buildIdFilter = ""
            , loading = True
            , route = MainView
            }
    in
        updateModelWithFilters (routeFromUrl defaultModel location) ! [ getBuildRecordList defaultModel ]


getBuildRecordList : Model -> Cmd Msg
getBuildRecordList { productFilter, channelFilter, platformFilter, versionFilter, localeFilter } =
    let
        request =
            client
                |> Kinto.getList recordResource
                |> Kinto.limit 10<commit_msg>Send the first request to Kinto using the filters from the URL<commit_after>module Model
    exposing
        ( init
        , getBuildRecordList
        , getNextBuilds
        , updateModelWithFilters
        )

import Decoder exposing (..)
import Filters exposing (..)
import Kinto
import Navigation exposing (..)
import Types exposing (..)
import Url exposing (..)


init : Location -> ( Model, Cmd Msg )
init location =
    let
        defaultModel =
            { buildsPager = Kinto.emptyPager client recordResource
            , filteredBuilds = []
            , filterValues = FilterValues productList channelList platformList versionList localeList
            , productFilter = "all"
            , versionFilter = "all"
            , platformFilter = "all"
            , channelFilter = "all"
            , localeFilter = "all"
            , buildIdFilter = ""
            , loading = True
            , route = MainView
            }

        updatedModel =
            updateModelWithFilters (routeFromUrl defaultModel location)
    in
        updatedModel ! [ getBuildRecordList updatedModel ]


getBuildRecordList : Model -> Cmd Msg
getBuildRecordList { productFilter, channelFilter, platformFilter, versionFilter, localeFilter } =
    let
        request =
            client
                |> Kinto.getList recordResource
                |> Kinto.limit 10
{'fraction_non_alphanumeric': 0.07288519637462236, 'fraction_numerical': 0.0015105740181268882, 'mean_word_length': 2.003401360544218, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2701207', 'n_tokens_mistral': 673, 'n_tokens_neox': 647, 'n_words': 180}