Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tehkillerbee committed Feb 7, 2024
1 parent 711e311 commit b1e6692
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions mopidy_tidal/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from mopidy_tidal.backend import TidalBackend

import logging
from pathlib import Path

from mopidy import backend
from tidalapi import Quality
from tidalapi.media import ManifestMimeType
from pathlib import Path

from . import Extension, context

Expand Down Expand Up @@ -41,15 +41,20 @@ def translate_uri(self, uri):
manifest = stream.get_stream_manifest()
logger.info("MimeType:{}".format(stream.manifest_mime_type))
logger.info(
"Starting playback of track:{}, (quality:{}, codec:{}, {}bit/{}Hz)".format(track_id,
stream.audio_quality,
manifest.get_codecs(),
stream.bit_depth,
stream.sample_rate))
"Starting playback of track:{}, (quality:{}, codec:{}, {}bit/{}Hz)".format(
track_id,
stream.audio_quality,
manifest.get_codecs(),
stream.bit_depth,
stream.sample_rate,
)
)
if stream.manifest_mime_type == ManifestMimeType.MPD.value:
hls = manifest.get_hls()
if hls:
hls_path = Path(Extension.get_cache_dir(context.get_config()), "hls.m3u8")
hls_path = Path(
Extension.get_cache_dir(context.get_config()), "hls.m3u8"
)
with open(hls_path, "w") as my_file:
my_file.write(hls)
return "file://{}".format(hls_path)
Expand Down

0 comments on commit b1e6692

Please sign in to comment.