2019-11-14 19:42:02 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <map>
|
2019-11-16 22:03:13 +00:00
|
|
|
#include <vector>
|
2019-11-14 19:42:02 +00:00
|
|
|
#include "playlist.h"
|
|
|
|
|
|
|
|
class PlaylistManager {
|
|
|
|
private:
|
|
|
|
std::map<String, String> _map;
|
|
|
|
std::map<String, Playlist*> _playlists;
|
2019-11-16 22:03:13 +00:00
|
|
|
std::vector<String> _unmapped_folders;
|
2019-11-17 13:26:23 +00:00
|
|
|
void _check_for_special_chars(String s);
|
|
|
|
void _save_mapping();
|
2019-11-14 19:42:02 +00:00
|
|
|
public:
|
|
|
|
PlaylistManager();
|
|
|
|
Playlist* get_playlist_for_id(String id);
|
2019-11-16 22:03:13 +00:00
|
|
|
Playlist* get_playlist_for_folder(String folder);
|
2019-11-14 19:42:02 +00:00
|
|
|
void dump_ids();
|
2019-11-17 13:26:23 +00:00
|
|
|
void scan_files();
|
2019-11-16 22:03:13 +00:00
|
|
|
String json();
|
2019-11-16 23:35:23 +00:00
|
|
|
bool add_mapping(String id, String folder);
|
2019-11-14 19:42:02 +00:00
|
|
|
};
|