<commit_before>"use strict";

(function(app) {
    app.controller("MainController", ["$scope", "UserService", "BookService", function($scope, UserService, BookService) {
        $scope.errorMessage = "";

        UserService.loginStatus().get(function(res) {
            $scope.isLoggedIn = res.status;
        });

        $scope.getBooks = function(params) {
            BookService.books()
                .get(params, function(res) {
                    if(res.status === false) {
                        $scope.errorMessage += (" " + res.result);
                    } else {
                        if(params.own === 1) {
                            $scope.mybooks = res.result;
                        } else {
                            $scope.books = res.result;
                        }
                    }
                });
        }

        $scope.addBook = function(searchTerms) {
            $scope.errorMessage = "";

            UserService.loginStatus().get(function(res) {<commit_msg>Show books in reverse chronological order<commit_after>"use strict";

(function(app) {
    app.controller("MainController", ["$scope", "UserService", "BookService", function($scope, UserService, BookService) {
        $scope.errorMessage = "";

        UserService.loginStatus().get(function(res) {
            $scope.isLoggedIn = res.status;
        });

        $scope.getBooks = function(params) {
            BookService.books()
                .get(params, function(res) {
                    if(res.status === false) {
                        $scope.errorMessage += (" " + res.result);
                    } else {
                        if(params.own === 1) {
                            $scope.mybooks = res.result.reverse();
                        } else {
                            $scope.books = res.result.reverse();
                        }
                    }
                });
        }

        $scope.addBook = function(searchTerms) {
            $scope.errorMessage = "";

            UserService.loginStatus().get(function(res) {
{'fraction_non_alphanumeric': 0.13262342691190707, 'fraction_numerical': 0.000968054211035818, 'mean_word_length': 1.3435374149659864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5810381', 'n_tokens_mistral': 535, 'n_tokens_neox': 504, 'n_words': 75}