Commit 52320bc3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

MetadataParser: Rename handleArtist -> findOrCreateArtist

parent 9220a4df
...@@ -122,7 +122,7 @@ bool MetadataParser::parseAudioFile( parser::Task& task ) const ...@@ -122,7 +122,7 @@ bool MetadataParser::parseAudioFile( parser::Task& task ) const
task.media->setThumbnail( task.artworkMrl ); task.media->setThumbnail( task.artworkMrl );
auto genre = handleGenre( task ); auto genre = handleGenre( task );
auto artists = handleArtists( task ); auto artists = findOrCreateArtist( task );
auto album = handleAlbum( task, artists.first, artists.second, genre.get() ); auto album = handleAlbum( task, artists.first, artists.second, genre.get() );
if ( album == nullptr ) if ( album == nullptr )
{ {
...@@ -284,13 +284,12 @@ std::shared_ptr<Album> MetadataParser::handleAlbum( parser::Task& task, std::sha ...@@ -284,13 +284,12 @@ std::shared_ptr<Album> MetadataParser::handleAlbum( parser::Task& task, std::sha
/// ///
/// \brief MetadataParser::handleArtists Returns Artist's involved on a track /// \brief MetadataParser::handleArtists Returns Artist's involved on a track
/// \param media The track to analyze /// \param task The current parser task
/// \param vlcMedia VLC's media
/// \return A pair containing: /// \return A pair containing:
/// The album artist as a first element /// The album artist as a first element
/// The track artist as a second element, or nullptr if it is the same as album artist /// The track artist as a second element, or nullptr if it is the same as album artist
/// ///
std::pair<std::shared_ptr<Artist>, std::shared_ptr<Artist>> MetadataParser::handleArtists( parser::Task& task ) const std::pair<std::shared_ptr<Artist>, std::shared_ptr<Artist>> MetadataParser::findOrCreateArtist( parser::Task& task ) const
{ {
std::shared_ptr<Artist> albumArtist; std::shared_ptr<Artist> albumArtist;
std::shared_ptr<Artist> artist; std::shared_ptr<Artist> artist;
......
...@@ -41,7 +41,7 @@ protected: ...@@ -41,7 +41,7 @@ protected:
std::shared_ptr<Album> findAlbum(parser::Task& task, Artist* albumArtist ) const; std::shared_ptr<Album> findAlbum(parser::Task& task, Artist* albumArtist ) const;
bool parseAudioFile(parser::Task& task) const; bool parseAudioFile(parser::Task& task) const;
bool parseVideoFile(parser::Task& task) const; bool parseVideoFile(parser::Task& task) const;
std::pair<std::shared_ptr<Artist>, std::shared_ptr<Artist>> handleArtists( parser::Task& vlcMedia ) const; std::pair<std::shared_ptr<Artist>, std::shared_ptr<Artist>> findOrCreateArtist( parser::Task& vlcMedia ) const;
std::shared_ptr<AlbumTrack> handleTrack( std::shared_ptr<Album> album, parser::Task& task, std::shared_ptr<AlbumTrack> handleTrack( std::shared_ptr<Album> album, parser::Task& task,
std::shared_ptr<Artist> artist, Genre* genre ) const; std::shared_ptr<Artist> artist, Genre* genre ) const;
bool link(Media& media, std::shared_ptr<Album> album, std::shared_ptr<Artist> albumArtist, std::shared_ptr<Artist> artist ) const; bool link(Media& media, std::shared_ptr<Album> album, std::shared_ptr<Artist> albumArtist, std::shared_ptr<Artist> artist ) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment