Skip to content

Commit

Permalink
Codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Laxilef authored Jan 8, 2025
1 parent 06f1000 commit 9cadfa9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/yandex_station/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,12 @@ async def head(self, request: web.Request, sid: str, uid: str, ext: str):
async with self.session.head(url, headers=headers) as r:
response = web.Response(status=r.status)
response.headers.update(r.headers)

# important for DLNA players
response.headers.update({
"Content-Type": MIME_TYPES[ext],
})

if not rng:
response.headers.update({
"Accept-Ranges": "bytes",
Expand All @@ -486,13 +488,17 @@ async def get(self, request: web.Request, sid: str, uid: str, ext: str):
async with self.session.get(url, headers=headers) as r:
response = web.StreamResponse(status=r.status)
response.headers.update(r.headers)

# important for DLNA players
response.headers.update({
"Content-Type": MIME_TYPES[ext],
})

if not rng:
response.headers.update({
"Accept-Ranges": "bytes",
})

await response.prepare(request)

# same chunks as default web.FileResponse
Expand Down

0 comments on commit 9cadfa9

Please sign in to comment.