cellSearch: fix cellSearchStartListSearch

Fixes listing BGM in Gundam.
The returned content was always empty.
Playback of the tracks will still require a MusicSelectionContext and cellMusic playback, which isn't implemented yet.
This commit is contained in:
Megamouse 2022-02-20 15:22:41 +01:00
parent 0a34403ef8
commit b1a9e87ecf
2 changed files with 31 additions and 21 deletions

View file

@ -21,4 +21,15 @@ namespace utils
};
std::pair<bool, media_info> get_media_info(const std::string& path, s32 av_media_type);
template <typename D>
void parse_metadata(D& dst, const utils::media_info& mi, const std::string& key, const std::string& def, usz max_length)
{
std::string value = mi.get_metadata<std::string>(key, def);
if (value.size() > max_length)
{
value.resize(max_length);
}
strcpy_trunc(dst, value);
};
}