Add m3u support#64
Conversation
Implement M3U file loading with entry trimming
|
Apologies for the slightly untidy multi commits, am a bit new to the best way to add changes on GitHub |
|
Thanks for adding this😊. I hadn’t considered M3U support for XM8 before, but it makes sense for frontends and multi-disk titles. I’d like to keep the macOS deployment target at 10.13. Could you avoid std::string ParentDirectory(const std::string& path)
{
const std::string::size_type slash = path.find_last_of("/\\");
if (slash == std::string::npos) {
return "";
}
return path.substr(0, slash + 1);
}
std::string ResolveM3UEntry(const std::string& baseDir, const std::string& entry)
{
if (entry.empty()) {
return entry;
}
if (entry[0] == '/' || entry[0] == '\\') {
return entry;
}
if (entry.size() >= 2 && std::isalpha(static_cast<unsigned char>(entry[0])) && entry[1] == ':') {
return entry;
}
return baseDir + entry;
}Then LoadM3U() can use ParentDirectory(path) once and append relative entries without requiring . |
avoid using std::filename for m3u support
|
no problem, have added in your changes and functionality is still the same, although I am on a later OSX build so I can't test 10.13 fully |
have added in a check if the Command line file if it's an M3U file then take the first two files and use them as disk 1 & 2