forked from mopidy/mopidy
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mopidy#2119 from mopidy/typing-m3u
Type mopidy.m3u
- Loading branch information
Showing
5 changed files
with
108 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
# ruff: noqa: ARG002 | ||
from __future__ import annotations | ||
|
||
from typing import ClassVar | ||
from typing import TYPE_CHECKING, ClassVar | ||
|
||
import pykka | ||
|
||
from mopidy import backend | ||
from mopidy.types import UriScheme | ||
|
||
from . import playlists | ||
|
||
if TYPE_CHECKING: | ||
from mopidy.audio import AudioProxy | ||
from mopidy.ext import Config | ||
|
||
|
||
class M3UBackend(pykka.ThreadingActor, backend.Backend): | ||
uri_schemes: ClassVar[list[str]] = ["m3u"] | ||
uri_schemes: ClassVar[list[UriScheme]] = [UriScheme("m3u")] | ||
|
||
def __init__(self, config, audio): | ||
def __init__( | ||
self, | ||
config: Config, | ||
audio: AudioProxy, # noqa: ARG002 | ||
) -> None: | ||
super().__init__() | ||
self.playlists = playlists.M3UPlaylistsProvider(self, config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
from typing import Literal, Optional, TypedDict | ||
|
||
|
||
class M3UConfig(TypedDict): | ||
base_dir: Optional[Path] | ||
default_encoding: str | ||
default_extension: Literal[".m3u", ".m3u8"] | ||
playlists_dir: Optional[Path] |