<commit_before>﻿var express = require('express')
	, request = require('request')
	, path = require('path')
	, multer = require('multer')
	, redis = require("redis")
	, lwip = require('lwip')
	, sha1 = require('sha1')
	, fs = require('fs')
	, freegeoip = require('node-freegeoip')
	, qs = require('querystring');

// Configuration.
var appURL = 'https://plex-discord-webhook.herokuapp.com';
var webhookKey = process.env.DISCORD_WEBHOOK_KEY;

var redisClient = redis.createClient(process.env.REDISCLOUD_URL, { return_buffers: true });
var upload = multer({ storage: multer.memoryStorage() });
var app = express();

app.use(express.static('images'));

function formatTitle(metadata) {
	if (metadata.grandparentTitle) {
		return metadata.grandparentTitle;
	} else {
		var ret = metadata.title;
		if (metadata.year) {
			ret += ' (' + metadata.year + ')';
		}
		return ret;
	}
}

function formatSubtitle(metadata) {
	var ret = '';
	if (metadata.grandparentTitle) {
		if (metadata.type == 'track') {
			ret = metadata.parentTitle;
		} else if (metadata.index && metadata.parentIndex) {
			ret = "S" + metadata.parentIndex + " E" + metadata.index;
		} else if (metadata.originallyAvailableAt) {
			ret = metadata.originallyAvailableAt;
		}

		if (metadata.title) {
			ret += ' - ' + metadata.title;
		}
	} else if (metadata.type == 'movie') {
		ret = metadata.tagline;
	}

	return ret;
}

function formatSummary(summary) {
	var ret = '';

	if (summary) {
		if (summary.length > 150) {
			ret = summary.substring(0, 150) + '...';
		}
		else {
			ret = summary;<commit_msg>increased summary length<commit_after>﻿var express = require('express')
	, request = require('request')
	, path = require('path')
	, multer = require('multer')
	, redis = require("redis")
	, lwip = require('lwip')
	, sha1 = require('sha1')
	, fs = require('fs')
	, freegeoip = require('node-freegeoip')
	, qs = require('querystring');

// Configuration.
var appURL = 'https://plex-discord-webhook.herokuapp.com';
var webhookKey = process.env.DISCORD_WEBHOOK_KEY;

var redisClient = redis.createClient(process.env.REDISCLOUD_URL, { return_buffers: true });
var upload = multer({ storage: multer.memoryStorage() });
var app = express();

app.use(express.static('images'));

function formatTitle(metadata) {
	if (metadata.grandparentTitle) {
		return metadata.grandparentTitle;
	} else {
		var ret = metadata.title;
		if (metadata.year) {
			ret += ' (' + metadata.year + ')';
		}
		return ret;
	}
}

function formatSubtitle(metadata) {
	var ret = '';
	if (metadata.grandparentTitle) {
		if (metadata.type == 'track') {
			ret = metadata.parentTitle;
		} else if (metadata.index && metadata.parentIndex) {
			ret = "S" + metadata.parentIndex + " E" + metadata.index;
		} else if (metadata.originallyAvailableAt) {
			ret = metadata.originallyAvailableAt;
		}

		if (metadata.title) {
			ret += ' - ' + metadata.title;
		}
	} else if (metadata.type == 'movie') {
		ret = metadata.tagline;
	}

	return ret;
}

function formatSummary(summary) {
	var ret = '';

	if (summary) {
		if (summary.length > 300) {
			ret = summary.substring(0, 300) + '...';
		}
		else {
			ret = summary;
{'fraction_non_alphanumeric': 0.16565785281936923, 'fraction_numerical': 0.005734310289901242, 'mean_word_length': 3.9293563579277864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '543572', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1080, 'n_words': 221}