feat: routes

This commit is contained in:
2026-06-06 13:00:01 +03:00
parent 83abcd02dd
commit 87b48e941e
22 changed files with 525 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
"""Subsonic-compatible API layer mounted at /rest."""
from fastapi import APIRouter
from app.api.rest.annotation import router as annotation_router
from app.api.rest.browsing import router as browsing_router
from app.api.rest.media import router as media_router
from app.api.rest.playlists import router as playlists_router
from app.api.rest.search import router as search_router
from app.api.rest.system import router as system_router
subsonic_router = APIRouter(tags=["subsonic"])
subsonic_router.include_router(system_router)
subsonic_router.include_router(browsing_router)
subsonic_router.include_router(search_router)
subsonic_router.include_router(playlists_router)
subsonic_router.include_router(media_router)
subsonic_router.include_router(annotation_router)
__all__ = ["subsonic_router"]
+23
View File
@@ -0,0 +1,23 @@
"""Subsonic annotation endpoints: star, rating, scrobble."""
from typing import Any
from fastapi import APIRouter
router = APIRouter()
@router.get("/star")
async def star() -> Any: ...
@router.get("/unstar")
async def unstar() -> Any: ...
@router.get("/setRating")
async def set_rating() -> Any: ...
@router.get("/scrobble")
async def scrobble() -> Any: ...
+47
View File
@@ -0,0 +1,47 @@
"""Subsonic browsing endpoints."""
from typing import Any
from fastapi import APIRouter
router = APIRouter()
@router.get("/getMusicFolders")
async def get_music_folders() -> Any: ...
@router.get("/getIndexes")
async def get_indexes() -> Any: ...
@router.get("/getMusicDirectory")
async def get_music_directory() -> Any: ...
@router.get("/getArtists")
async def get_artists() -> Any: ...
@router.get("/getArtist")
async def get_artist() -> Any: ...
@router.get("/getAlbum")
async def get_album() -> Any: ...
@router.get("/getAlbumList")
async def get_album_list() -> Any: ...
@router.get("/getAlbumList2")
async def get_album_list2() -> Any: ...
@router.get("/getSong")
async def get_song() -> Any: ...
@router.get("/getGenres")
async def get_genres() -> Any: ...
+19
View File
@@ -0,0 +1,19 @@
"""Subsonic media endpoints: stream, download, cover art."""
from typing import Any
from fastapi import APIRouter
router = APIRouter()
@router.get("/stream")
async def stream() -> Any: ...
@router.get("/download")
async def download() -> Any: ...
@router.get("/getCoverArt")
async def get_cover_art() -> Any: ...
+27
View File
@@ -0,0 +1,27 @@
"""Subsonic playlist endpoints."""
from typing import Any
from fastapi import APIRouter
router = APIRouter()
@router.get("/getPlaylists")
async def get_playlists() -> Any: ...
@router.get("/getPlaylist")
async def get_playlist() -> Any: ...
@router.get("/createPlaylist")
async def create_playlist() -> Any: ...
@router.get("/updatePlaylist")
async def update_playlist() -> Any: ...
@router.get("/deletePlaylist")
async def delete_playlist() -> Any: ...
+11
View File
@@ -0,0 +1,11 @@
"""Subsonic search endpoints."""
from typing import Any
from fastapi import APIRouter
router = APIRouter()
@router.get("/search3")
async def search3() -> Any: ...
+15
View File
@@ -0,0 +1,15 @@
"""Subsonic system endpoints: ping and license."""
from typing import Any
from fastapi import APIRouter
router = APIRouter()
@router.get("/ping")
async def ping() -> Any: ...
@router.get("/getLicense")
async def get_license() -> Any: ...