<commit_before>angular.module('jamm')
.controller('MovieDetailController', function ($scope, MovieService, $stateParams, $state) {
    var movies = MovieService.movies;

    var movieId = $stateParams.id;
    if (movieId) {
        $scope.originalMovie = _.find(movies, { id: movieId });
        $scope.movie = angular.copy($scope.originalMovie);
    }

    $scope.isModified = false;

    $scope.$watch('movie', function (value) {
        $scope.isModified = !_.isEqual(value, $scope.originalMovie);
    }, true);

    $scope.save = function() {
        $scope.originalMovie = MovieService.updateMovie($scope.originalMovie.id, $scope.movie);
        $scope.movie = angular.copy($scope.originalMovie);
        $scope.isModified = false;
    };

    $scope.discard = function() {
        $scope.movie = angular.copy($scope.originalMovie);
    };

    $scope.delete = function () {
        _.remove(movies, { id: $scope.originalMovie.id });
        $('#confirmDeleteModal').on('hidden.bs.modal', function () {
            $state.go('movies');
        });
        $('#confirmDeleteModal').modal('hide');
    };

    $scope.selectedVideoIndex = 0;

    $scope.selectVideo = function (index) {
        $scope.selectedVideoIndex = index;
        angular.element('#videoPlayer').attr('src', $scope.movie.storage.videos[$scope.selectedVideoIndex].file);
    };

    $scope.initVideoPlayer = function () {
        $scope.selectVideo($scope.selectedVideoIndex);
        var player = new MediaElementPlayer('#videoPlayer', {
            videoWidth: '100%',
            videoHeight: '100%',
            success: function(mediaElement, originalNode) {
                // do things
            }
        });
    };

});
<commit_msg>Replace _.isEquals with angular.equals<commit_after>angular.module('jamm')
.controller('MovieDetailController', function ($scope, MovieService, $stateParams, $state) {
    var movies = MovieService.movies;

    var movieId = $stateParams.id;
    if (movieId) {
        $scope.originalMovie = _.find(movies, { id: movieId });
        $scope.movie = angular.copy($scope.originalMovie);
    }

    $scope.isModified = false;

    $scope.$watch('movie', function (value) {
        $scope.isModified = !angular.equals(value, $scope.originalMovie);
        console.log(value);
        console.log($scope.originalMovie);
    }, true);

    $scope.save = function() {
        $scope.originalMovie = MovieService.updateMovie($scope.originalMovie.id, $scope.movie);
        $scope.movie = angular.copy($scope.originalMovie);
        $scope.isModified = false;
    };

    $scope.discard = function() {
        $scope.movie = angular.copy($scope.originalMovie);
    };

    $scope.delete = function () {
        _.remove(movies, { id: $scope.originalMovie.id });
        $('#confirmDeleteModal').on('hidden.bs.modal', function () {
            $state.go('movies');
        });
        $('#confirmDeleteModal').modal('hide');
    };

    $scope.selectedVideoIndex = 0;

    $scope.selectVideo = function (index) {
        $scope.selectedVideoIndex = index;
        angular.element('#videoPlayer').attr('src', $scope.movie.storage.videos[$scope.selectedVideoIndex].file);
    };

    $scope.initVideoPlayer = function () {
        $scope.selectVideo($scope.selectedVideoIndex);
        var player = new MediaElementPlayer('#videoPlayer', {
            videoWidth: '100%',
            videoHeight: '100%',
            success: function(mediaElement, originalNode) {
                // do things
            }
        });
    };

});

{'fraction_non_alphanumeric': 0.1583262651964942, 'fraction_numerical': 0.003958156629912355, 'mean_word_length': 2.7124868835257083, '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': '6328227', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1000, 'n_words': 159}