Cleaning up code.

Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
2021-05-26 16:06:13 -04:00
parent a00a8e8113
commit 7cbca29be2
5 changed files with 12 additions and 7 deletions

View File

@@ -1,3 +1,4 @@
---
repos:
- repo: local
hooks:
@@ -38,7 +39,12 @@ repos:
entry: reorder-python-imports
language: system
types: [python]
args: [--application-directories=src, --py39-plus]
args:
[
--application-directories=src,
--py39-plus,
--exit-zero-even-if-changed,
]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer

View File

@@ -3,6 +3,7 @@ import click
from playlist import plex
@click.command()
@click.version_option()
def main() -> None:

View File

@@ -1,5 +1,4 @@
"""Application-level constants."""
import dataclasses
import pathlib

View File

@@ -1,7 +1,7 @@
"""Contains the code to communicate to the Plex server."""
import typing
import aioreactive as rx
import aioreactive as rx # type: ignore
import plexapi.audio # type: ignore
import plexapi.server # type: ignore
@@ -32,7 +32,7 @@ def gen_batched_tracks(
pos += batch_size
async def track_mapper(track: plexapi.audio.Track) -> dict:
async def track_mapper(track: plexapi.audio.Track) -> dict[str, typing.Any]:
return {
"id": track.ratingKey,
"track_num": track.index,
@@ -54,8 +54,7 @@ async def gen_tracks(
*,
batch_size: int = 100,
) -> typing.AsyncGenerator[plexapi.audio.Track, None]:
"""
Generate all Tracks from the Server, asynchronously.
"""Generate all Tracks from the Server, asynchronously.
Keyword Args:
batch_size: determines how many Tracks are pulled from the Server at a time.

View File

@@ -2,7 +2,7 @@
import dataclasses
import typing
import desert
import desert # type: ignore
import yaml
from playlist import const