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

Code before:
  int SetDetailsForItem(CVideoInfoTag& details, const std::map<std::string, std::string> &artwork);
  int SetDetailsForItem(int id, const MediaType& mediaType, CVideoInfoTag& details, const std::map<std::string, std::string> &artwork);

  int SetDetailsForMovie(CVideoInfoTag& details,
                         const std::map<std::string, std::string>& artwork,
                         int idMovie = -1);
  int SetDetailsForMovieSet(const CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, int idSet = -1);

  /*! \brief add a tvshow to the library, setting metadata detail
   First checks for whether this TV Show is already in the database (based on idTvShow, or via GetMatchingTvShow)
   and if present adds the paths to the show.  If not present, we add a new show and set the show metadata.
   \param paths a vector<string,string> list of the path(s) and parent path(s) for the show.
   \param details a CVideoInfoTag filled with the metadata for the show.
   \param artwork the artwork map for the show.
   \param seasonArt the artwork map for seasons.
   \param idTvShow the database id of the tvshow if known (defaults to -1)
   \return the id of the tvshow.
   */
  int SetDetailsForTvShow(const std::vector< std::pair<std::string, std::string> > &paths, CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, const std::map<int, std::map<std::string, std::string> > &seasonArt, int idTvShow = -1);
  bool UpdateDetailsForTvShow(int idTvShow, CVideoInfoTag &details, const std::map<std::string, std::string> &artwork, const std::map<int, std::map<std::string, std::string> > &seasonArt);
  int SetDetailsForSeason(const CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, int idShow, int idSeason = -1);
  int SetDetailsForEpisode(CVideoInfoTag& details,
                           const std::map<std::string, std::string>& artwork,
                           int idShow,
                           int idEpisode = -1);
  bool SetFileForEpisode(const std::string& fileAndPath, const int idEpisode, const int oldIdFile);
  bool SetFileForMovie(const std::string& fileAndPath, const int oldIdFile);
  int SetDetailsForMusicVideo(CVideoInfoTag& details,
                              const std::map<std::string, std::string>& artwork,
                              int idMVideo = -1);
  bool SetStreamDetailsForFile(const CStreamDetails& details,
                               const std::string& strFileNameAndPath);
  /*!
   * \brief Clear any existing stream details and add the new provided details to a file.
   * \param[in] details New stream details
   * \param[in] idFile Identifier of the file
   * \return operation success. true for success, false for failure
   */
  bool SetStreamDetailsForFileId(const CStreamDetails& details, int idFile) const;

  bool SetSingleValue(VideoDbContentType type, int dbId, int dbField, const std::string& strValue);
  bool SetSingleValue(VideoDbContentType type,
                      int dbId,
                      Field dbField,
                      const std::string& strValue);
  bool SetSingleValue(const std::string &table, const std::string &fieldName, const std::string &strValue,
                      const std::string &conditionName = "", int conditionValue = -1);

  int UpdateDetailsForMovie(int idMovie, CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, const std::set<std::string> &updatedDetails);

  /*!

Review comment (suggestion):
Please drop `const` from the ints here. As ints are passed by value, a copy is always created, so const never affects anything outside this function, and as a result adds clutter to the external API without providing any real protection or optimization.

Code after:
  int SetDetailsForItem(CVideoInfoTag& details, const std::map<std::string, std::string> &artwork);
  int SetDetailsForItem(int id, const MediaType& mediaType, CVideoInfoTag& details, const std::map<std::string, std::string> &artwork);

  int SetDetailsForMovie(CVideoInfoTag& details,
                         const std::map<std::string, std::string>& artwork,
                         int idMovie = -1);
  int SetDetailsForMovieSet(const CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, int idSet = -1);

  /*! \brief add a tvshow to the library, setting metadata detail
   First checks for whether this TV Show is already in the database (based on idTvShow, or via GetMatchingTvShow)
   and if present adds the paths to the show.  If not present, we add a new show and set the show metadata.
   \param paths a vector<string,string> list of the path(s) and parent path(s) for the show.
   \param details a CVideoInfoTag filled with the metadata for the show.
   \param artwork the artwork map for the show.
   \param seasonArt the artwork map for seasons.
   \param idTvShow the database id of the tvshow if known (defaults to -1)
   \return the id of the tvshow.
   */
  int SetDetailsForTvShow(const std::vector< std::pair<std::string, std::string> > &paths, CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, const std::map<int, std::map<std::string, std::string> > &seasonArt, int idTvShow = -1);
  bool UpdateDetailsForTvShow(int idTvShow, CVideoInfoTag &details, const std::map<std::string, std::string> &artwork, const std::map<int, std::map<std::string, std::string> > &seasonArt);
  int SetDetailsForSeason(const CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, int idShow, int idSeason = -1);
  int SetDetailsForEpisode(CVideoInfoTag& details,
                           const std::map<std::string, std::string>& artwork,
                           int idShow,
                           int idEpisode = -1);
  bool SetFileForEpisode(const std::string& fileAndPath, int idEpisode, int oldIdFile);
  bool SetFileForMovie(const std::string& fileAndPath, int idMovie, int oldIdFile);
  int SetDetailsForMusicVideo(CVideoInfoTag& details,
                              const std::map<std::string, std::string>& artwork,
                              int idMVideo = -1);
  bool SetStreamDetailsForFile(const CStreamDetails& details,
                               const std::string& strFileNameAndPath);
  /*!
   * \brief Clear any existing stream details and add the new provided details to a file.
   * \param[in] details New stream details
   * \param[in] idFile Identifier of the file
   * \return operation success. true for success, false for failure
   */
  bool SetStreamDetailsForFileId(const CStreamDetails& details, int idFile);

  bool SetSingleValue(VideoDbContentType type, int dbId, int dbField, const std::string& strValue);
  bool SetSingleValue(VideoDbContentType type,
                      int dbId,
                      Field dbField,
                      const std::string& strValue);
  bool SetSingleValue(const std::string &table, const std::string &fieldName, const std::string &strValue,
                      const std::string &conditionName = "", int conditionValue = -1);

  int UpdateDetailsForMovie(int idMovie, CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, const std::set<std::string> &updatedDetails);

  /*!