From e036eff4e25079fc7cdec26817514fb4a4b184c4 Mon Sep 17 00:00:00 2001 From: evilchili Date: Tue, 6 Dec 2022 16:34:58 -0800 Subject: [PATCH] removing add from cli --- groove/cli.py | 45 +-------------------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/groove/cli.py b/groove/cli.py index bc5746f..4b13ef4 100644 --- a/groove/cli.py +++ b/groove/cli.py @@ -3,7 +3,7 @@ import os import typer from pathlib import Path -from typing import Optional, List +from typing import Optional from dotenv import load_dotenv from slugify import slugify from rich import print @@ -89,49 +89,6 @@ def get( print(pl.as_dict) -@playlist_app.command() -def add( - name: str = typer.Argument( - ..., - help="The name of the playlist to create." - ), - description: str = typer.Option( - None, - help="The description of the playlist." - ), - tracks: List[str] = typer.Option( - None, - help="A list of tracks to add to the playlist." - ), - exists_ok: bool = typer.Option( - True, - help="If True, it is okay if the playlist already exists." - ), - multiples_ok: bool = typer.Option( - False, - help="If True, the same track can be added to the playlist multiple times." - ) -): - """ - Create a new playlist with the specified name, unless it already exists. - """ - initialize() - with database_manager() as manager: - pl = Playlist( - slug=slugify(name), - session=manager.session, - name=name, - description=description, - create_if_not_exists=True) - if pl.exists: - if not exists_ok: - raise RuntimeError(f"Playlist with slug {pl.slug} already exists!") - logging.debug(pl.as_dict) - if tracks: - pl.add(tracks) - print(pl.as_dict) - - @app.command() def scan( root: Optional[Path] = typer.Option(