<commit_before>package main

import (
	"github.com/ant0ine/go-json-rest/rest"
	"github.com/imheresamir/picast"
	"log"
	"net/http"
)

func main() {

	mainMedia := picast.Media{Metadata: &picast.PlaylistEntry{}}
	api := picast.Api{CurrentMedia: &mainMedia}
	api.InitDB()

	log.Println("Server Started.")

	handler := rest.ResourceHandler{
		EnableRelaxedContentType: true,
	}
	handler.SetRoutes(
		&rest.Route{"GET", "/api/entries", api.GetAllEntries},
		&rest.Route{"GET", "/api/entries/:id", api.GetEntry},
		&rest.Route{"POST", "/api/entries", api.PostEntry},
		&rest.Route{"DELETE", "/api/entries/:id", api.DeleteEntry},

		&rest.Route{"POST", "/api/playall", api.PlayAll},
		&rest.Route{"POST", "/api/prev", api.Prev},
		&rest.Route{"POST", "/api/next", api.Next},

		&rest.Route{"POST", "/api/play", mainMedia.Play},
		&rest.Route{"POST", "/api/pause", mainMedia.TogglePause},
		&rest.Route{"POST", "/api/stop", mainMedia.Stop},
	)

	http.ListenAndServe(":8082", &handler)
}<commit_msg>Changed rest endpoints for player controls<commit_after>package main

import (
	"github.com/ant0ine/go-json-rest/rest"
	"github.com/imheresamir/picast"
	"log"
	"net/http"
)

func main() {

	mainMedia := picast.Media{Metadata: &picast.PlaylistEntry{}}
	api := picast.Api{CurrentMedia: &mainMedia}
	api.InitDB()

	log.Println("Server Started.")

	handler := rest.ResourceHandler{
		EnableRelaxedContentType: true,
	}
	handler.SetRoutes(
		&rest.Route{"GET", "/api/entries", api.GetAllEntries},
		&rest.Route{"GET", "/api/entries/:id", api.GetEntry},
		&rest.Route{"POST", "/api/entries", api.PostEntry},
		&rest.Route{"DELETE", "/api/entries/:id", api.DeleteEntry},

		&rest.Route{"POST", "/api/playall", api.PlayAll},
		&rest.Route{"POST", "/api/prev", api.Prev},
		&rest.Route{"POST", "/api/next", api.Next},

		&rest.Route{"POST", "/media/play", mainMedia.Play},
		&rest.Route{"POST", "/media/pause", mainMedia.TogglePause},
		&rest.Route{"POST", "/media/stop", mainMedia.Stop},
	)

	http.ListenAndServe(":8082", &handler)
}
{'fraction_non_alphanumeric': 0.21339950372208435, 'fraction_numerical': 0.004962779156327543, 'mean_word_length': 4.929411764705883, 'pattern_counts': {'":': 2, '<': 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': '3460748', 'n_tokens_mistral': 789, 'n_tokens_neox': 750, 'n_words': 115}