Repository: xbmc/xbmc
File: xbmc/video/VideoDatabase.h (C/C++)

Code before:
  \return count of music video IDs found.
  */
  unsigned int GetRandomMusicVideoIDs(const std::string& strWhere, std::vector<std::pair<int, int> > &songIDs);

  static void VideoContentTypeToString(VideoDbContentType type, std::string& out)
  {
    switch (type)
    {
      case VideoDbContentType::MOVIES:
        out = MediaTypeMovie;
        break;
      case VideoDbContentType::TVSHOWS:
        out = MediaTypeTvShow;
        break;
      case VideoDbContentType::EPISODES:
        out = MediaTypeEpisode;
        break;
      case VideoDbContentType::MUSICVIDEOS:
        out = MediaTypeMusicVideo;
        break;
      default:
        break;
    }
  }

  void SetArtForItem(int mediaId, const MediaType &mediaType, const std::string &artType, const std::string &url) const;
  void SetArtForItem(int mediaId, const MediaType &mediaType, const std::map<std::string, std::string> &art);
  bool GetArtForItem(int mediaId, const MediaType &mediaType, std::map<std::string, std::string> &art);
  std::string GetArtForItem(int mediaId, const MediaType &mediaType, const std::string &artType);

  /*!
   * \brief Retrieve all art for the given video asset, with optional fallback to the art of the
   * parent/owner of the asset
   * \param assetId id of the file of the asset
   * \param fallback optionally request fallback to the art of the parent/owner for each art type
     that is not defined for the asset
   * \param art collection of the retrieved art
   * \return 
  */
  bool GetArtForAsset(int assetId,
                      ArtFallbackOptions fallback,
                      std::map<std::string, std::string>& art);
  bool HasArtForItem(int mediaId, const MediaType &mediaType);
  bool RemoveArtForItem(int mediaId, const MediaType &mediaType, const std::string &artType);
  bool RemoveArtForItem(int mediaId, const MediaType &mediaType, const std::set<std::string> &artTypes);
  bool GetTvShowSeasons(int showId, std::map<int, int> &seasons);
  bool GetTvShowNamedSeasons(int showId, std::map<int, std::string> &seasons);

  /*!
   * \brief Get the custom named season.
   * \param tvshowId The tv show id relative to the season.

Review comment (bug):
From the logical POV a setter method being `const` looks somehow wrong as "set" implies "change". 

Code after:
  \return count of music video IDs found.
  */
  unsigned int GetRandomMusicVideoIDs(const std::string& strWhere, std::vector<std::pair<int, int> > &songIDs);

  static void VideoContentTypeToString(VideoDbContentType type, std::string& out)
  {
    switch (type)
    {
      case VideoDbContentType::MOVIES:
        out = MediaTypeMovie;
        break;
      case VideoDbContentType::TVSHOWS:
        out = MediaTypeTvShow;
        break;
      case VideoDbContentType::EPISODES:
        out = MediaTypeEpisode;
        break;
      case VideoDbContentType::MUSICVIDEOS:
        out = MediaTypeMusicVideo;
        break;
      default:
        break;
    }
  }

  void SetArtForItem(int mediaId, const MediaType &mediaType, const std::string &artType, const std::string &url);
  void SetArtForItem(int mediaId, const MediaType &mediaType, const std::map<std::string, std::string> &art);
  bool GetArtForItem(int mediaId, const MediaType &mediaType, std::map<std::string, std::string> &art);
  std::string GetArtForItem(int mediaId, const MediaType &mediaType, const std::string &artType);

  /*!
   * \brief Retrieve all art for the given video asset, with optional fallback to the art of the
   * parent/owner of the asset
   * \param assetId id of the file of the asset
   * \param fallback optionally request fallback to the art of the parent/owner for each art type
     that is not defined for the asset
   * \param art collection of the retrieved art
   * \return 
  */
  bool GetArtForAsset(int assetId,
                      ArtFallbackOptions fallback,
                      std::map<std::string, std::string>& art);
  bool HasArtForItem(int mediaId, const MediaType &mediaType);
  bool RemoveArtForItem(int mediaId, const MediaType &mediaType, const std::string &artType);
  bool RemoveArtForItem(int mediaId, const MediaType &mediaType, const std::set<std::string> &artTypes);
  bool GetTvShowSeasons(int showId, std::map<int, int> &seasons);
  bool GetTvShowNamedSeasons(int showId, std::map<int, std::string> &seasons);

  /*!
   * \brief Get the custom named season.
   * \param tvshowId The tv show id relative to the season.