<commit_before>const Movie = require('src/movie/movie');

function convertTmdbToMovie(tmdbMovie) {
	const movie = new Movie();
	movie.title = tmdbMovie.title;
	movie.type = 'movie';

	if (tmdbMovie.release_date !== undefined) {
		movie.release_date = new Date(tmdbMovie.release_date);
		movie.year = movie.release_date.getFullYear();
	}
<commit_msg>Now handles movies and tv shows<commit_after>const Movie = require('src/movie/movie');

function convertTmdbToMovie(tmdbMovie) {
	const movie = new Movie();
	if (tmdbMovie.media_type === 'movie') {
		movie.title = tmdbMovie.title;
		movie.type = tmdbMovie.media_type;

		if (tmdbMovie.release_date !== undefined) {
			movie.release_date = new Date(tmdbMovie.release_date);
			movie.year = movie.release_date.getFullYear();
		}
	} else if (tmdbMovie.media_type === 'tv') {
		movie.title = tmdbMovie.name;
		movie.type = 'show';
		if (tmdbMovie.first_air_date !== undefined) {
			movie.release_date = new Date(tmdbMovie.first_air_date);
			movie.year = movie.release_date.getFullYear();
		}
	}

	movie.poster = tmdbMovie.poster_path;
	movie.background = tmdbMovie.backdrop_path;

{'fraction_non_alphanumeric': 0.13587921847246892, 'fraction_numerical': 0.0, 'mean_word_length': 4.869791666666667, 'pattern_counts': {'":': 0, '<': 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': '5807253', 'n_tokens_mistral': 466, 'n_tokens_neox': 396, 'n_words': 70}