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

add endoint without .view #211

Closed vincentDcmps closed 3 years ago

codecov[bot] commented 3 years ago

Codecov Report

Merging #211 (e22620b) into master (c52141e) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #211   +/-   ##
=======================================
  Coverage   88.53%   88.53%           
=======================================
  Files          35       35           
  Lines        3358     3358           
=======================================
  Hits         2973     2973           
  Misses        385      385           
Impacted Files Coverage Δ
supysonic/api/albums_songs.py 94.95% <100.00%> (ø)
supysonic/api/annotation.py 100.00% <100.00%> (ø)
supysonic/api/browse.py 92.00% <100.00%> (ø)
supysonic/api/chat.py 100.00% <100.00%> (ø)
supysonic/api/jukebox.py 17.85% <100.00%> (ø)
supysonic/api/media.py 94.51% <100.00%> (ø)
supysonic/api/playlists.py 97.26% <100.00%> (ø)
supysonic/api/radio.py 100.00% <100.00%> (ø)
supysonic/api/scan.py 52.00% <100.00%> (ø)
supysonic/api/search.py 100.00% <100.00%> (ø)
... and 2 more

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 c52141e...e22620b. Read the comment docs.

spl0k commented 3 years ago

Actually it would be better if we had a new decorator that registered both routes rather than specifying each time the two versions. That would prevent typos or missing route registration. Ideally something like

@the_awesome_new_decorator("someEndpoint")
def da_function():
    ...

would be equivalent to

@api.route("someEndpoint", methods=["GET", "POST"])
@api.route("someEndpoint.view", methods=["GET", "POST"])
def da_function():
    ...

Do you think you can handle it?

vincentDcmps commented 3 years ago

yes I will, I have think to that two day ago but not apply yesterday ^^

vincentDcmps commented 3 years ago

@spl0k please review

vincentDcmps commented 3 years ago

done