Commit 0f5c7df9 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Provide a default sorting criteria & sorting order for interface methods

parent d89d58d7
......@@ -42,13 +42,13 @@ public:
/**
* @brief tracks fetches album tracks from the database
*/
virtual std::vector<std::shared_ptr<IMedia>> tracks( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<std::shared_ptr<IMedia>> tracks( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
/**
* @brief tracks fetches album tracks, filtered by genre
* @param genre A musical genre. Only tracks of this genre will be returned
* @return
*/
virtual std::vector<std::shared_ptr<IMedia>> tracks( GenrePtr genre, medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<std::shared_ptr<IMedia>> tracks( GenrePtr genre, medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
/**
* @brief albumArtist Returns the album main artist (generally tagged as album-artist)
*/
......
......@@ -34,8 +34,8 @@ public:
virtual int64_t id() const = 0;
virtual const std::string& name() const = 0;
virtual const std::string& shortBio() const = 0;
virtual std::vector<AlbumPtr> albums( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<MediaPtr> media( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<AlbumPtr> albums( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
virtual std::vector<MediaPtr> media( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
virtual const std::string& artworkMrl() const = 0;
virtual const std::string& musicBrainzId() const = 0;
};
......@@ -32,7 +32,7 @@ public:
virtual ~IGenre() = default;
virtual int64_t id() const = 0;
virtual const std::string& name() const = 0;
virtual std::vector<ArtistPtr> artists( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<AlbumTrackPtr> tracks( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<AlbumPtr> albums( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<ArtistPtr> artists( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
virtual std::vector<AlbumTrackPtr> tracks( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
virtual std::vector<AlbumPtr> albums( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
};
......@@ -131,10 +131,10 @@ class IMediaLibrary
virtual LabelPtr createLabel( const std::string& label ) = 0;
virtual bool deleteLabel( LabelPtr label ) = 0;
virtual std::vector<MediaPtr> audioFiles( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<MediaPtr> videoFiles( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<MediaPtr> audioFiles( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
virtual std::vector<MediaPtr> videoFiles( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
virtual AlbumPtr album( int64_t id ) const = 0;
virtual std::vector<AlbumPtr> albums( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<AlbumPtr> albums( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
virtual ShowPtr show( const std::string& name ) const = 0;
virtual MoviePtr movie( const std::string& title ) const = 0;
virtual ArtistPtr artist( int64_t id ) const = 0;
......@@ -145,19 +145,19 @@ class IMediaLibrary
* @param sort A sorting criteria. So far, this is ignored, and artists are sorted by lexial order
* @param desc If true, the provided sorting criteria will be reversed.
*/
virtual std::vector<ArtistPtr> artists( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<ArtistPtr> artists( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
/**
* @brief genres Return the list of music genres
* @param sort A sorting criteria. So far, this is ignored, and artists are sorted by lexial order
* @param desc If true, the provided sorting criteria will be reversed.
*/
virtual std::vector<GenrePtr> genres( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<GenrePtr> genres( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
/***
* Playlists
*/
virtual PlaylistPtr createPlaylist( const std::string& name ) = 0;
virtual std::vector<PlaylistPtr> playlists( medialibrary::SortingCriteria sort, bool desc ) = 0;
virtual std::vector<PlaylistPtr> playlists( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) = 0;
virtual bool deletePlaylist( int64_t playlistId ) = 0;
/**
......
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