Closed simon-weber closed 6 years ago
I lied, it's not that easy to trigger. I had built a cycle like this:
A: title match B
B: id match A
I can recreate it, but I haven't really figured out what's going on yet.
I moved cycle detection into getLinkedTracks, but the important part was initializing the cache to the empty set upon first seeing a playlist: that way, if we see it again, we terminate the cycle. I'm not really sure why the previous code worked without this (maybe it didn't?).
Even self-cycles! For example, creating a playlist titled "foo" and then matching for playlist titles containing "foo".
I'm surprised this isn't built into the existing cycle detection logic. Hopefully it's straightforward to do.