<commit_before>/**
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <glib.h>

#include "xmmsclient.h"

#define XMMS_MAX_URI_LEN 1024

#define STOPPED 1
#define PLAYING 2

static GMainLoop *mainloop;
gint duration;
gint status;

void
print_mediainfo (xmmsc_connection_t *conn, gint id) 
{
	GHashTable *entry;

	entry = xmmsc_playlist_get_mediainfo (conn, id);

	if (!entry) {
		printf ("id %d doesn't exist in playlist", id);
		return;
	}
	
	printf ("URI:    %s\n", (gchar *)g_hash_table_lookup (entry, "uri"));
	printf ("Artist: %-30s ", (gchar *)g_hash_table_lookup (entry, "artist"));
	printf ("Album: %-30s\n", (gchar *)g_hash_table_lookup (entry, "album"));
	printf ("Title:  %-30s ", (gchar *)g_hash_table_lookup (entry, "title"));
	printf ("Year: %s\n", (gchar *)g_hash_table_lookup (entry, "year"));

	xmmsc_playlist_entry_free (entry);
}

void
handle_playtime (void *userdata, void *arg) {
	guint tme = GPOINTER_TO_UINT(arg);
	if (status == STOPPED) 
		return;
	printf ("played time: %02d:%02d of %02d:%02d\r",
		tme/60000,
		(tme/1000)%60,
		duration/60,
		(duration)%60);
	fflush (stdout);
}

void
handle_playback_stopped (void *userdata, void *arg) 
{
	printf ("\nPlayback stopped...\n");<commit_msg>Use correct playlist-entry field for "year".<commit_after>/**
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <glib.h>

#include "xmmsclient.h"

#define XMMS_MAX_URI_LEN 1024

#define STOPPED 1
#define PLAYING 2

static GMainLoop *mainloop;
gint duration;
gint status;

void
print_mediainfo (xmmsc_connection_t *conn, gint id) 
{
	GHashTable *entry;

	entry = xmmsc_playlist_get_mediainfo (conn, id);

	if (!entry) {
		printf ("id %d doesn't exist in playlist", id);
		return;
	}
	
	printf ("URI:    %s\n", (gchar *)g_hash_table_lookup (entry, "uri"));
	printf ("Artist: %-30s ", (gchar *)g_hash_table_lookup (entry, "artist"));
	printf ("Album: %-30s\n", (gchar *)g_hash_table_lookup (entry, "album"));
	printf ("Title:  %-30s ", (gchar *)g_hash_table_lookup (entry, "title"));
	printf ("Year: %s\n", (gchar *)g_hash_table_lookup (entry, "date"));

	xmmsc_playlist_entry_free (entry);
}

void
handle_playtime (void *userdata, void *arg) {
	guint tme = GPOINTER_TO_UINT(arg);
	if (status == STOPPED) 
		return;
	printf ("played time: %02d:%02d of %02d:%02d\r",
		tme/60000,
		(tme/1000)%60,
		duration/60,
		(duration)%60);
	fflush (stdout);
}

void
handle_playback_stopped (void *userdata, void *arg) 
{
	printf ("\nPlayback stopped...\n");
{'fraction_non_alphanumeric': 0.17138302112395376, 'fraction_numerical': 0.027899561578318056, 'mean_word_length': 4.919811320754717, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5605069', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1032, 'n_words': 246}