mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-18 17:25:22 -04:00
Finish downloadables
This commit is contained in:
parent
4e2709468b
commit
95e906a196
6 changed files with 525 additions and 39 deletions
|
@ -3,7 +3,6 @@
|
|||
import logging
|
||||
import os
|
||||
import sqlite3
|
||||
from typing import Tuple, Union
|
||||
|
||||
logger = logging.getLogger("streamrip")
|
||||
|
||||
|
@ -76,7 +75,7 @@ class Database:
|
|||
|
||||
return bool(conn.execute(command, tuple(items.values())).fetchone()[0])
|
||||
|
||||
def __contains__(self, keys: Union[str, dict]) -> bool:
|
||||
def __contains__(self, keys: str | dict) -> bool:
|
||||
"""Check whether a key-value pair exists in the database.
|
||||
|
||||
:param keys: Either a dict with the structure {key: value_to_search_for, ...},
|
||||
|
@ -96,7 +95,7 @@ class Database:
|
|||
|
||||
raise TypeError(keys)
|
||||
|
||||
def add(self, items: Union[str, Tuple[str]]):
|
||||
def add(self, items: str | tuple[str]):
|
||||
"""Add a row to the table.
|
||||
|
||||
:param items: Column-name + value. Values must be provided for all cols.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue