<commit_before>/* queued_song.js
 * A Backbone wrapper for the queued_song model.
 */

var BackboneDBModel = require('../backbone_db_model');
var queued_song_model = require('../../models/queued_song');

module.exports = BackboneDBModel.extend({
  initialize: function() {
    this.constructor.__super__.initialize.apply(this, arguments);
  },

  model: function() {
    return queued_song_model.QueuedSong;
  },

  toJSON: function() {
    var data = {
      order: this.get('order')
    };

    var song = this.get('song');

    Object.keys(song).forEach(function(song_key) {
      data[song_key] = song[song_key];
    });

    return data;
  }
});

<commit_msg>Cleaned up queued_song.toJSON().<commit_after>/* queued_song.js
 * A Backbone wrapper for the queued_song model.
 */

var BackboneDBModel = require('../backbone_db_model');
var queued_song_model = require('../../models/queued_song');

module.exports = BackboneDBModel.extend({
  initialize: function() {
    this.constructor.__super__.initialize.apply(this, arguments);
  },

  model: function() {
    return queued_song_model.QueuedSong;
  },

  toJSON: function() {
    var song = this.get('song');

    var artwork_file = song.artwork;

    return {
      order: this.get('order'),
      title: song.title,
      artist: song.artist,
      album: song.album,
      duration: song.duration,
      id: song.id,
      artwork_path: (artwork_file ? '/artwork/' + artwork_file.filename : null)
    };
  }
});


{'fraction_non_alphanumeric': 0.1487771739130435, 'fraction_numerical': 0.0, 'mean_word_length': 3.294460641399417, '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': '2611843', 'n_tokens_mistral': 507, 'n_tokens_neox': 479, 'n_words': 92}