<commit_before>package br.com.eduardofbs.plexcleaner;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.JAXBException;
import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import br.com.eduardofbs.plexcleaner.model.Directory;
import br.com.eduardofbs.plexcleaner.model.Media;
import br.com.eduardofbs.plexcleaner.model.Part;
import br.com.eduardofbs.plexcleaner.model.Video;

public class Main {

	public static void main(String[] args)
			throws IOException, ParserConfigurationException, SAXException, JAXBException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		System.out.println("Enter your Plex login");
		String login = br.readLine();

		System.out.println("Enter your Plex password");
		String password = br.readLine();

		String authenticationToken = Controller.getAuthorizationToken(login, password);

		List<Directory> libraries = Controller.listLibraries(authenticationToken);

		System.out.println("Found libraries:");

		long allLibrariesSize = 0L;

		for (Directory library : libraries) {
			String title = library.getTitle();

			System.out.println(String.format("Title: %s", title));

			String key = library.getKey();
			String type = library.getType();

			List<Video> videos = Controller.listWatched(authenticationToken, key, type);

			if (videos == null)
				return;

			List<String> filesToErase = new ArrayList<>();

			System.out.println("All these files will be erased");

			long allVideosSize = 0L;

			for (Video video : videos) {
				Media media = video.getMedia();

				Part part = media.getPart();

				String filePath = part.getFile();

				File file = new File(filePath);

				long fileSize = file.length();

				allVideosSize += fileSize;

				String prettyFileSize = Main.readableFileSize(fileSize);

				System.out.println(String.format("%s %s", filePath, prettyFileSize));
<commit_msg>#1 Fix in minor refactor<commit_after>package br.com.eduardofbs.plexcleaner;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.JAXBException;
import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import br.com.eduardofbs.plexcleaner.model.Directory;
import br.com.eduardofbs.plexcleaner.model.Media;
import br.com.eduardofbs.plexcleaner.model.Part;
import br.com.eduardofbs.plexcleaner.model.Video;

public class Main {

	public static void main(String[] args)
			throws IOException, ParserConfigurationException, SAXException, JAXBException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		System.out.println("Enter your Plex login");
		String login = br.readLine();

		System.out.println("Enter your Plex password");
		String password = br.readLine();

		String authenticationToken = Controller.getAuthorizationToken(login, password);

		List<Directory> libraries = Controller.listLibraries(authenticationToken);

		System.out.println("Found libraries:");

		long allLibrariesSize = 0L;

		for (Directory library : libraries) {
			String title = library.getTitle();

			System.out.println(String.format("Title: %s", title));

			String key = library.getKey();
			String type = library.getType();

			List<Video> videos = Controller.listWatched(authenticationToken, key, type);

			if (videos == null)
				continue;

			List<String> filesToErase = new ArrayList<>();

			System.out.println("All these files will be erased");

			long allVideosSize = 0L;

			for (Video video : videos) {
				Media media = video.getMedia();

				Part part = media.getPart();

				String filePath = part.getFile();

				File file = new File(filePath);

				long fileSize = file.length();

				allVideosSize += fileSize;

				String prettyFileSize = Main.readableFileSize(fileSize);

				System.out.println(String.format("%s %s", filePath, prettyFileSize));

{'fraction_non_alphanumeric': 0.11604342581423402, 'fraction_numerical': 0.0012062726176115801, 'mean_word_length': 4.718620689655173, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '2137398', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1226, 'n_words': 286}