"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.seasonPosterPath = exports.mediaItemSlug = exports.mediaItemPosterPath = exports.mediaItemColumns = exports.mediaItemBackdropPath = void 0;

var _dateFns = require("date-fns");

var _slug = require("../slug");

const mediaItemColumns = ['backdrop', 'developer', 'genres', 'id', 'igdbId', 'imdbId', 'audibleId', 'lastTimeUpdated', 'mediaType', 'network', 'numberOfSeasons', 'openlibraryId', 'originalTitle', 'overview', 'platform', 'poster', 'releaseDate', 'tmdbRating', 'runtime', 'source', 'status', 'title', 'tmdbId', 'tvmazeId', 'url', 'needsDetails', 'authors', 'narrators', 'language', 'goodreadsId', 'numberOfPages', 'traktId', 'audibleCountryCode', 'slug', 'tvdbId'];
exports.mediaItemColumns = mediaItemColumns;

const mediaItemPosterPath = (mediaItemId, size) => {
  return `img/poster?${new URLSearchParams({
    mediaItemId: mediaItemId.toString(),
    size: size
  })}`;
};

exports.mediaItemPosterPath = mediaItemPosterPath;

const mediaItemBackdropPath = mediaItemId => {
  return `img/backdrop?${new URLSearchParams({
    mediaItemId: mediaItemId.toString()
  })}`;
};

exports.mediaItemBackdropPath = mediaItemBackdropPath;

const seasonPosterPath = (seasonId, size) => {
  return `img/poster?${new URLSearchParams({
    seasonId: seasonId.toString(),
    size: size
  })}`;
};

exports.seasonPosterPath = seasonPosterPath;

const mediaItemSlug = mediaItem => {
  if (mediaItem.releaseDate) {
    return (0, _slug.toSlug)(`${mediaItem.title}-${(0, _dateFns.parseISO)(mediaItem.releaseDate).getFullYear()}`);
  } else {
    return (0, _slug.toSlug)(mediaItem.title);
  }
};

exports.mediaItemSlug = mediaItemSlug;
//# sourceMappingURL=mediaItem.js.map