henkelis / sonospy

Sonospy is a UPnP control point and Windows Media proxy for the Sonos multi-room audio system.
GNU General Public License v3.0
113 stars 16 forks source link

Slow adding items to playlist #86

Open nestoracunablanco opened 6 years ago

nestoracunablanco commented 6 years ago

Adding a lot items to the playlist can in some cases be too slow. Enough to produce the sonos timeout error (1002). It turns out that some "os.path" operations in the webserver.py module are responsible. Commenting them didn't show me any side effects (not yet). Are there so important?

nestoracunablanco commented 6 years ago

Please check: https://github.com/henkelis/sonospy/commit/6cebd6eaa019193fb024d7a559199cb6f49e7bda#diff-8831a2975c22c4ee1ee8e94cf212a91c

henkelis commented 6 years ago

Certainly the calls that result in warnings can be commented out. The last check that checks if the item is a folder ought not to occur - the worst that would happen if it was removed is that the file wouldn't get served, which would happen anyway. I don't see a problem commenting them all out.