parent
083f4011aa
commit
fbe047a35f
@ -1,3 +1,14 @@ |
||||
#pragma once |
||||
|
||||
namespace database {} // namespace database
|
||||
#include <string> |
||||
|
||||
namespace database { |
||||
|
||||
struct FileInfo { |
||||
bool is_playable; |
||||
std::string title; |
||||
}; |
||||
|
||||
auto GetInfo(const std::string &path, FileInfo *out) -> bool; |
||||
|
||||
} // namespace database
|
||||
|
@ -0,0 +1,15 @@ |
||||
#include "tag_processor.hpp" |
||||
|
||||
namespace database { |
||||
|
||||
auto GetInfo(const std::string &path, FileInfo *out) -> bool { |
||||
// TODO(jacqueline): bring in taglib for this
|
||||
if (path.ends_with(".mp3")) { |
||||
out->is_playable = true; |
||||
out->title = path.substr(0, path.size() - 4); |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
} // namespace database
|
Loading…
Reference in new issue