Skip to content

Add m3u support#64

Merged
bubio merged 7 commits into
bubio:mainfrom
retropieuser:main
Jun 16, 2026
Merged

Add m3u support#64
bubio merged 7 commits into
bubio:mainfrom
retropieuser:main

Conversation

@retropieuser

Copy link
Copy Markdown
Contributor

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

@retropieuser

Copy link
Copy Markdown
Contributor Author

Apologies for the slightly untidy multi commits, am a bit new to the best way to add changes on GitHub

@bubio

bubio commented Jun 16, 2026

Copy link
Copy Markdown
Owner

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. std::filesystem requires a newer macOS deployment target with Apple’s libc++, but this feature only needs simple path joining for M3U entries.

Could you avoid std::filesystem and keep the deployment target at 10.13? Something like this should be enough here:

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
@retropieuser

Copy link
Copy Markdown
Contributor Author

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

@bubio bubio merged commit 5aa05ae into bubio:main Jun 16, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants