spl0k / supysonic

Supysonic is a Python implementation of the Subsonic server API.
https://supysonic.readthedocs.io
GNU Affero General Public License v3.0
260 stars 57 forks source link

Implement dummy method to getVideos.view #192

Closed ogarcia closed 3 years ago

ogarcia commented 3 years ago

Supysonic targets the version API 1.9.0 that supports getVideos.view, is better return an empty list that a not supported message because some clients won't understand it.

Feel free to change copyright in videos.py. Is my template system that add these header to new files :smile:

codecov-commenter commented 3 years ago

Codecov Report

Merging #192 into master will decrease coverage by 0.65%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #192      +/-   ##
==========================================
- Coverage   86.83%   86.18%   -0.66%     
==========================================
  Files          39       40       +1     
  Lines        3540     3546       +6     
==========================================
- Hits         3074     3056      -18     
- Misses        466      490      +24     
Impacted Files Coverage Δ
supysonic/api/unsupported.py 100.00% <ø> (ø)
supysonic/api/__init__.py 98.78% <100.00%> (+0.01%) :arrow_up:
supysonic/api/videos.py 100.00% <100.00%> (ø)
supysonic/api/media.py 85.25% <0.00%> (-10.14%) :arrow_down:
supysonic/api/formatters.py 91.11% <0.00%> (-2.23%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b438bb0...2152b44. Read the comment docs.

spl0k commented 3 years ago

Any client in particular? I suspect it's not the error they don't like but the fact that it's returned along a 501 HTTP status code.

ogarcia commented 3 years ago

Ultrasonic for example

spl0k commented 3 years ago

I won't accept this PR as an empty success is different than an error, and requesting an unsupported method should be an error. As for client compatibility, I removed the HTTP status code from error responses, so every response, be it a success or an error, will have a 200 HTTP status code. But just ignoring the response body if the HTTP code isn't in the 2xx range is bad design from clients I think.