<commit_before>(function(){
	angular
		.module("movieMash")
		.factory("scoreService",scoreService);

		scoreService.$inject=['localStorageService','$firebaseArray','firebaseDataService'];

		function scoreService(localStorageService,$firebaseArray,firebaseDataService){
			var scoresSyncArray = $firebaseArray(firebaseDataService.scores);
			var service={
				getAllScores:getAllScores,
				addPointToMovie:addPointToMovie,
				removePointToMovie:removePointToMovie
			};
			return service;

			function getAllScores(){
				return scoresSyncArray;
			}

			function addPointToMovie(movie){
                var movieObj = scoresSyncArray.$getRecord(movie.id);
                if(movieObj){                    
                   movieObj.points ++;
                    scoresSyncArray.$save({movieObj});
                }else{
                    scoresSyncArray.$add({
                        $id:movie.id,
                        movie:movie,
                        points:1
                    });
                }
            }

			function removePointToMovie(movie){
				var points = localStorageService.get(movie.id) ? localStorageService.get(movie.id).points : 0;
				points --;
				localStorageService.set(movie.id,{movie:movie,points:points});
			}
		}

})();<commit_msg>Fix an bug into the id generation for a score record.<commit_after>(function(){
	angular
		.module("movieMash")
		.factory("scoreService",scoreService);

		scoreService.$inject=['localStorageService','$firebaseArray','firebaseDataService'];

		function scoreService(localStorageService,$firebaseArray,firebaseDataService){
			var scoresSyncArray = $firebaseArray(firebaseDataService.scores);
			var service={
				getAllScores:getAllScores,
				addPointToMovie:addPointToMovie,
				removePointToMovie:removePointToMovie
			};
			return service;

			function getAllScores(){
				return scoresSyncArray;
			}

			function addPointToMovie(movie){
                var movieObj = scoresSyncArray.$getRecord(movie.id);
                if(movieObj){                    
                   movieObj.points ++;
                    scoresSyncArray.$save({movieObj});
                }else{
                    scoresSyncArray.$ref().child(movie.id).set({
                        movie:movie,
                        points:1
                    });
                }
            }

			function removePointToMovie(movie){
				var points = localStorageService.get(movie.id) ? localStorageService.get(movie.id).points : 0;
				points --;
				localStorageService.set(movie.id,{movie:movie,points:points});
			}
		}

})();
{'fraction_non_alphanumeric': 0.10973724884080371, 'fraction_numerical': 0.0015455950540958269, 'mean_word_length': 2.323491655969191, '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': '6693903', 'n_tokens_mistral': 841, 'n_tokens_neox': 669, 'n_words': 95}