add nxmp and switch wave file assoc, remove old sphaira file assoc, replace ext/db assoc parse code with views::split
This commit is contained in:
2
assets/romfs/assoc/SwitchWave.ini
Normal file
2
assets/romfs/assoc/SwitchWave.ini
Normal file
@@ -0,0 +1,2 @@
|
||||
[config]
|
||||
supported_extensions=mp3|ogg|flac|wav|aac|ac3|aif|asf|mp4|mkv|m3u|m3u8|hls|vob|avi|dv|flv|m2ts|m2v|m4a|mov|mpeg|mpg|mts|swf|ts|vob|wma|wmv|png|jpg|jpeg|bmp|gif
|
||||
2
assets/romfs/assoc/nxmp.ini
Normal file
2
assets/romfs/assoc/nxmp.ini
Normal file
@@ -0,0 +1,2 @@
|
||||
[config]
|
||||
supported_extensions=mp3|ogg|flac|wav|aac|ac3|aif|asf|mp4|mkv|m3u|m3u8|hls|vob|avi|dv|flv|m2ts|m2v|m4a|mov|mpeg|mpg|mts|swf|ts|vob|wma|wmv|png|jpg|jpeg|bmp|gif
|
||||
@@ -1,2 +0,0 @@
|
||||
[config]
|
||||
ext=nro
|
||||
@@ -2011,30 +2011,24 @@ void Menu::LoadAssocEntriesPath(const fs::FsPath& path) {
|
||||
|
||||
ini_browse([](const mTCHAR *Section, const mTCHAR *Key, const mTCHAR *Value, void *UserData) {
|
||||
auto assoc = static_cast<FileAssocEntry*>(UserData);
|
||||
if (!strcmp(Key, "path")) {
|
||||
if (!std::strcmp(Key, "path")) {
|
||||
assoc->path = Value;
|
||||
} else if (!strcmp(Key, "supported_extensions")) {
|
||||
for (int i = 0; Value[i]; i++) {
|
||||
for (int j = i; ; j++) {
|
||||
if (Value[j] == '|' || Value[j] == '\0') {
|
||||
assoc->ext.emplace_back(Value + i, j - i);
|
||||
i += j - i;
|
||||
break;
|
||||
}
|
||||
} else if (!std::strcmp(Key, "supported_extensions")) {
|
||||
for (const auto& p : std::views::split(std::string_view{Value}, '|')) {
|
||||
if (p.empty()) {
|
||||
continue;
|
||||
}
|
||||
assoc->ext.emplace_back(p.data(), p.size());
|
||||
}
|
||||
} else if (!strcmp(Key, "database")) {
|
||||
for (int i = 0; Value[i]; i++) {
|
||||
for (int j = i; ; j++) {
|
||||
if (Value[j] == '|' || Value[j] == '\0') {
|
||||
assoc->database.emplace_back(Value + i, j - i);
|
||||
i += j - i;
|
||||
break;
|
||||
}
|
||||
} else if (!std::strcmp(Key, "database")) {
|
||||
for (const auto& p : std::views::split(std::string_view{Value}, '|')) {
|
||||
if (p.empty()) {
|
||||
continue;
|
||||
}
|
||||
assoc->database.emplace_back(p.data(), p.size());
|
||||
}
|
||||
} else if (!strcmp(Key, "use_base_name")) {
|
||||
if (!strcmp(Value, "true") || !strcmp(Value, "1")) {
|
||||
} else if (!std::strcmp(Key, "use_base_name")) {
|
||||
if (!std::strcmp(Value, "true") || !std::strcmp(Value, "1")) {
|
||||
assoc->use_base_name = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user