Right now the code will let you add a folder and one of its descendants as library locations. That will cause the detector to potentially discover the same files in both structures, which won't have unique URLs, meaning they'll probably cause the All Programs view diffable data source to crash.
The solution is probably to de-duplicate in the program detector. Alternatively, we could store the parent location alongside items and unique on both that and the URL. Either way, it might be useful to store the parent as it would make it easier to implement a 'Reveal in Library' later on.
Right now the code will let you add a folder and one of its descendants as library locations. That will cause the detector to potentially discover the same files in both structures, which won't have unique URLs, meaning they'll probably cause the All Programs view diffable data source to crash.
The solution is probably to de-duplicate in the program detector. Alternatively, we could store the parent location alongside items and unique on both that and the URL. Either way, it might be useful to store the parent as it would make it easier to implement a 'Reveal in Library' later on.