<commit_before>
const TMDB = require('src/media_classes/tmdb');

function translateYear(tmdbReleaseDate) {
   return new Date(tmdbReleaseDate).getFullYear();
}

function translateGenre(tmdbGenres) {
   return tmdbGenres.map(genre => genre.name);
}

function convertType(tmdbType) {
   if (tmdbType === 'tv') return 'show';
   return undefined;
}

function convertTmdbToSeasoned(tmdb, manualType = undefined) {
   const title = tmdb.title || tmdb.name;
   const year = translateYear(tmdb.release_date || tmdb.first_air_date);
   const type = manualType || convertType(tmdb.media_type) || 'movie';

   const id = tmdb.id;
   const summary = tmdb.overview;
   const poster_path = tmdb.poster_path;
   const background_path = tmdb.backdrop_path;
   const popularity = tmdb.popularity;
   const score = tmdb.vote_average;
   // const genres = translateGenre(tmdb.genres);
   const release_status = tmdb.status;
   const tagline = tmdb.tagline;

   const seasons = tmdb.number_of_seasons;
   const episodes = tmdb.episodes;

   const seasoned = new TMDB(
      title, year, type, id, summary, poster_path, background_path,
      popularity, score, release_status, tagline, seasons, episodes,
   );

   // seasoned.print()
   return seasoned;
}

module.exports = convertTmdbToSeasoned;
<commit_msg>Removed unused semicolon<commit_after>
const TMDB = require('src/media_classes/tmdb');

function translateYear(tmdbReleaseDate) {
   return new Date(tmdbReleaseDate).getFullYear();
}

function translateGenre(tmdbGenres) {
   return tmdbGenres.map(genre => genre.name);
}

function convertType(tmdbType) {
   if (tmdbType === 'tv') return 'show';
   return undefined;
}

function convertTmdbToSeasoned(tmdb, manualType = undefined) {
   const title = tmdb.title || tmdb.name;
   const year = translateYear(tmdb.release_date || tmdb.first_air_date);
   const type = manualType || convertType(tmdb.media_type) || 'movie';

   const id = tmdb.id;
   const summary = tmdb.overview;
   const poster_path = tmdb.poster_path;
   const background_path = tmdb.backdrop_path;
   const popularity = tmdb.popularity;
   const score = tmdb.vote_average;
   // const genres = translateGenre(tmdb.genres);
   const release_status = tmdb.status;
   const tagline = tmdb.tagline;

   const seasons = tmdb.number_of_seasons;
   const episodes = tmdb.episodes;

   const seasoned = new TMDB(
      title, year, type, id, summary, poster_path, background_path,
      popularity, score, release_status, tagline, seasons, episodes
   );

   // seasoned.print()
   return seasoned;
}

module.exports = convertTmdbToSeasoned;

{'fraction_non_alphanumeric': 0.10841049382716049, 'fraction_numerical': 0.0, 'mean_word_length': 4.281059063136456, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1682763', 'n_tokens_mistral': 919, 'n_tokens_neox': 872, 'n_words': 192}