<commit_before>angular.module('moped.widgets', [
  'moped.util'
])
.directive('mopedTrack', function(util) {
  return {
    restrict: 'EA',
    scope: {
      trackNo: '=',
      track: '='
    },
    replace: true,
    link: function(scope, element, attrs) {
      scope.artistsAsString = function() {
        return util.getTrackArtistsAsString(scope.track);
      };
      scope.trackDuration = function() {
        return util.getTrackDuration(scope.track);
      };
      scope.playTrack = function() {
        scope.$emit('moped:playtrackrequest', scope.track);
        return false;
      };
      scope.$on('mopidy:event:trackPlaybackStarted', function(event, data) {
        scope.isPlaying = data.tl_track.track.uri === scope.track.uri;
        scope.$apply();
      });

      scope.$on('mopidy:event:trackPlaybackPaused', function(event, data) {
        scope.isPlaying = data.tl_track.track.uri === scope.track.uri;
        scope.$apply();
      });

      scope.$on('moped:currenttrackrequested', function(track) {
        scope.isPlaying = track.uri === scope.track.uri;
        scope.$apply();
      });
    },
    controller : function ($scope) {

    },
    templateUrl: 'widgets/track.tpl.html'
  };
});<commit_msg>Set page title via route property.<commit_after>angular.module('moped.widgets', [
  'moped.util'
])
.directive('mopedTrack', function(util) {
  return {
    restrict: 'EA',
    scope: {
      trackNo: '=',
      track: '='
    },
    replace: true,
    templateUrl: 'widgets/track.tpl.html',
    link: function(scope, element, attrs) {
      scope.artistsAsString = function() {
        return util.getTrackArtistsAsString(scope.track);
      };
      scope.trackDuration = function() {
        return util.getTrackDuration(scope.track);
      };
      scope.playTrack = function() {
        scope.$emit('moped:playtrackrequest', scope.track);
        return false;
      };
      var cleanUpTrackPlaybackStarted = scope.$on('mopidy:event:trackPlaybackStarted', function(event, data) {
        scope.isPlaying = data.tl_track.track.uri === scope.track.uri;
        scope.$apply();
      });

      var cleanUpTrackPlaybackPaused = scope.$on('mopidy:event:trackPlaybackPaused', function(event, data) {
        scope.isPlaying = data.tl_track.track.uri === scope.track.uri;
        scope.$apply();
      });

      var cleanUpCurrentTrackRequested = scope.$on('moped:currenttrackrequested', function(track) {
        scope.isPlaying = track.uri === scope.track.uri;
        scope.$apply();
      });

      $scope.$on('$destroy', function() {
        cleanUpTrackPlaybackStarted();
        cleanUpTrackPlaybackPaused();
        cleanUpCurrentTrackRequested();
      };
    }
  };
});
{'fraction_non_alphanumeric': 0.15432780847145489, 'fraction_numerical': 0.0, 'mean_word_length': 2.772222222222222, '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': '503241', 'n_tokens_mistral': 843, 'n_tokens_neox': 826, 'n_words': 123}