<commit_before>package com.bwfcwalshy.flarebot.music;

import com.arsenarsen.lavaplayerbridge.hooks.QueueHook;
import com.arsenarsen.lavaplayerbridge.player.Item;
import com.arsenarsen.lavaplayerbridge.player.Player;
import com.arsenarsen.lavaplayerbridge.player.Playlist;
import com.arsenarsen.lavaplayerbridge.player.Track;
import com.bwfcwalshy.flarebot.FlareBot;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;

import java.util.ArrayList;
import java.util.List;

public class QueueListener implements QueueHook {

    @Override
    public void execute(Player player, Item item) {
        List<Track> tracks = new ArrayList<>();
        if (item instanceof Playlist) {
            ((Playlist) item).getPlaylist().forEach(tracks::add);
        } else {
            tracks.add((Track) item);
        }

        sendQueueData(tracks);
    }

    private void sendQueueData(List<Track> tracks) {
        JsonArray array = new JsonArray();
        for (Track t : tracks) {
            array.add(t.getTrack().getIdentifier());
        }

        FlareBot.getInstance().postToApi("updatePlaylists", "playlist", array);
    }
}<commit_msg>* Change the playlist data, this now includes the song name.<commit_after>package com.bwfcwalshy.flarebot.music;

import com.arsenarsen.lavaplayerbridge.hooks.QueueHook;
import com.arsenarsen.lavaplayerbridge.player.Item;
import com.arsenarsen.lavaplayerbridge.player.Player;
import com.arsenarsen.lavaplayerbridge.player.Playlist;
import com.arsenarsen.lavaplayerbridge.player.Track;
import com.bwfcwalshy.flarebot.FlareBot;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;

import java.util.ArrayList;
import java.util.List;

public class QueueListener implements QueueHook {

    @Override
    public void execute(Player player, Item item) {
        List<Track> tracks = new ArrayList<>();
        if (item instanceof Playlist) {
            ((Playlist) item).getPlaylist().forEach(tracks::add);
        } else {
            tracks.add((Track) item);
        }

        sendQueueData(tracks);
    }

    private void sendQueueData(List<Track> tracks) {
        JsonArray array = new JsonArray();
        for (Track t : tracks) {
            JsonObject object = new JsonObject();
            object.addProperty("title", t.getTrack().getInfo().title);
            object.addProperty("id", t.getTrack().getIdentifier());
            array.add(object);
        }

        FlareBot.getInstance().postToApi("updatePlaylists", "playlist", array);
    }
}
{'fraction_non_alphanumeric': 0.11559778305621536, 'fraction_numerical': 0.0, 'mean_word_length': 3.3871527777777777, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '137104', 'n_tokens_mistral': 769, 'n_tokens_neox': 751, 'n_words': 146}