Allow advanced searching of music names
Meorawr opened this issue ยท 1 comments
The current implementation restricts callers to a prefix search. An optional flag should be added to the FindMusicFiles
function to allow it to run a string.find
based pattern search.
This'll likely take the form of an (optional) options table to allow future expansion if necessary.
LibRPMedia:FindMusicFiles("void_?elf", { method = "pattern" }) -- Pattern match
LibRPMedia:FindMusicFiles("voidelf", { method = "substring" }) -- Substring search
LibRPMedia:FindMusicFiles("voidelf", { method = "prefix" }) -- Prefix search
LibRPMedia:FindMusicFiles("voidelf") -- Prefix search might remain the default?
One change that this would allow is removing the basename entries for each file, instead just keeping their sound kit names + full file path. That'll remove ~3.5k names from the search table. The other API functions would, as a result, return the file path rather than the basename (if available).
The reason for having basenames was because of prefix searching, but with an advanced search API they're not as important.