[Need help]: Compose m3u8 playlist
Posted: 26 Oct 2015 06:59
I have a music folder with a lot of XY tags. I want to write each tag to a playlist file, i.e: file Instrumental.m3u8 list all files having the tag "Instrumental".
The tricky thing is:
1) .m3u8 only accept UTF-8 and UTF-8 with BOM while XY writefile() only accept ANSI and UTF-8 LE
2) That folder have A LOT of files, thus The follwing script is too slow to retrieve the list of files having the same tag:Anyone have a more efficient code?
The tricky thing is:
1) .m3u8 only accept UTF-8 and UTF-8 with BOM while XY writefile() only accept ANSI and UTF-8 LE
2) That folder have A LOT of files, thus The follwing script is too slow to retrieve the list of files having the same tag:
Code: Select all
$allitems = report("<curpath>\{Name}|");
$TagList = formatlist(report("{Tags}, "),"nde", ", ");
foreach ($tag, $TagList, ", ") {
$List = "";
foreach($item, $allitems) {
if( gettokenindex($tag, property("#tags", $item), ", ", "i")) {
$List = $List . "<crlf>" . $item;
}
}
writefile("<curpath>\$tag.m3u8", $List, , "tu");
};