2024-09-29 17:29:10 +03:00
|
|
|
#pragma once
|
|
|
|
#include <filesystem>
|
|
|
|
#include <string>
|
|
|
|
|
2024-10-02 17:51:51 +03:00
|
|
|
#include "includes/toml.hpp"
|
|
|
|
|
2024-09-29 17:29:10 +03:00
|
|
|
namespace fs = std::filesystem;
|
|
|
|
|
2024-10-05 00:03:50 +03:00
|
|
|
enum class KotoLibraryType {
|
|
|
|
Audiobooks,
|
|
|
|
Music,
|
|
|
|
Podcasts,
|
|
|
|
};
|
|
|
|
|
|
|
|
KotoLibraryType libraryTypeFromString(const std::string& type);
|
|
|
|
std::string libraryTypeToString(KotoLibraryType type);
|
|
|
|
|
2024-09-29 17:29:10 +03:00
|
|
|
class KotoLibraryConfig {
|
2024-10-02 17:51:51 +03:00
|
|
|
public:
|
2024-10-05 00:03:50 +03:00
|
|
|
KotoLibraryConfig(std::string name, fs::path path, KotoLibraryType type);
|
2024-10-02 17:51:51 +03:00
|
|
|
KotoLibraryConfig(const toml::value& v);
|
|
|
|
~KotoLibraryConfig();
|
2024-10-05 00:03:50 +03:00
|
|
|
std::string getName();
|
|
|
|
fs::path getPath();
|
|
|
|
KotoLibraryType getType();
|
|
|
|
toml::ordered_value serialize();
|
2024-10-02 17:51:51 +03:00
|
|
|
|
|
|
|
private:
|
2024-10-05 00:03:50 +03:00
|
|
|
std::string i_name;
|
|
|
|
fs::path i_path;
|
|
|
|
KotoLibraryType i_type;
|
2024-09-29 17:29:10 +03:00
|
|
|
};
|