YCLIMP
Yandex Command Line Interface Music Player
Loading...
Searching...
No Matches
PlaylistDao Class Reference

The PlaylistDao class - Database class to manipulate playlist related data
. More...

#include <PlaylistDao.hpp>

Public Member Functions

 PlaylistDao (SQLite::Database &database)
void Init () const
int AddPlaylist (const std::string &name) const
int AddNewOrGetPlaylist (const std::string &name) const
 If playlist with such name existed, return it's id.
void RenamePlaylist (int id, const std::string &newName) const
std::vector< DBPlaylistFetchAll () const
void AddTracksToPlaylist (int playlistId, std::vector< int > trackIds) const
void AddTrackToPlaylist (int playlistId, int trackId) const

Detailed Description

The PlaylistDao class - Database class to manipulate playlist related data
.

Has 3 types of tables:
1) One table with all playlists
2) Table for each playlist defining tracks order in that playlist
3) Table for each playlist defining based on sources
(based on sources - if one of the sources have new tracks, the playlist will be also updated)

  • All the methods should be const

Member Function Documentation

◆ AddNewOrGetPlaylist()

int PlaylistDao::AddNewOrGetPlaylist ( const std::string & name) const

If playlist with such name existed, return it's id.

Parameters
name- playlist name
Returns
playlist id (existed or newly created)

The documentation for this class was generated from the following files: