Closed arcnmx closed 4 years ago
Seems like they do, didn't notice that before you mentioned it XD
Reversing the list should be alright? Probably don't need to sort tracks by number. I did find a place in YtdlPlaylistPlugin.cxx
that reverses the playlist.
std::forward_list<DetachedSong> songs;
if (metadata.GetEntries().empty()) {
std::string url(uri /* metadata.GetWebpageURL() */);
url.insert(0, "ytdl://");
songs.emplace_front(url.c_str(), std::move(playlist));
} else {
for (auto &entry : metadata.GetEntries()) {
std::string url = entry.GetWebpageURL().empty()
? entry.GetURL() : entry.GetWebpageURL();
url.insert(0, "ytdl://");
songs.emplace_front(url.c_str(), entry.GetTagBuilder().Commit());
}
songs.reverse();
}
if its relevant.
Hm, convoluted...
entries.emplace_front()
, which ends up with them in reversed orderplaylist_index
attribute.
emplace_front
, so reverses it as it adds them.reverse()
fixes it yet againSo um, probably for fixing it:
TagHandler::entries
should be a different type than forward_list
, something that can efficiently append to the end of the list in O(1)forward_list songs
in the right order
songs.reverse();
Eh alternatively, just keep it as-is and just remove the songs.reverse()
. Same difference, then just swap the polarity of the playlist_index sort.
If playlist_index
doesn't exist anynore, do we keep the sorting? Maybe replace it with reverse()
?
Eh well it doesn't need to be replaced with anything if we just erase the songs.reverse()
above. It can either be removed or fixed by swapping <
and >
.
I'm not sure how I feel about removing it - if full mode is ever enabled or youtube-dl decides to include it in the json for certain extracotrs then it should be there... but maybe it won't be, dunno.
I think swapping <
and >
is a good idea.
As far as I can tell they do anyway?