Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions nix/modules/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let
;
inherit (lib.types)
bool
float
ints
nullOr
path
port
Expand Down Expand Up @@ -83,9 +83,9 @@ in
};

downloadDelay = mkOption {
type = float;
default = 0.0;
example = 5.0;
type = ints.unsigned;
default = 0;
example = 5;
description = ''
Number of seconds to wait before starting each individual song
download. When set to a value greater than zero, downloads are
Expand Down Expand Up @@ -168,7 +168,7 @@ in
// (optionalAttrs (cfg.ytDlpArgs != null) {
yt_dlp_args = cfg.ytDlpArgs;
})
// (optionalAttrs (cfg.downloadDelay != 0.0) {
// (optionalAttrs (cfg.downloadDelay != 0) {
download_delay = cfg.downloadDelay;
});
configFile =
Expand Down
6 changes: 3 additions & 3 deletions src/streamdl/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class State:
downloads: dict[str, Download]
executor: concurrent.futures.Executor
futures: list[concurrent.futures.Future]
download_delay: float
download_delay: int


@dataclass
Expand Down Expand Up @@ -99,7 +99,7 @@ def initialize() -> State:
# It serialises downloads and inserts a sleep between each one to avoid
# triggering YouTube rate limits. Default of 0 means no delay / parallel
# downloads (the original behaviour).
download_delay: float = float(config.pop("download_delay", 0))
download_delay: int = int(config.pop("download_delay", 0))

spotdl.utils.spotify.SpotifyClient.init(
**spotdl.utils.config.SpotifyOptions(
Expand Down Expand Up @@ -191,7 +191,7 @@ def group_songs(
def _download_with_delay(
downloader: spotdl.download.downloader.Downloader,
song: spotdl.types.song.Song,
delay: float,
delay: int,
) -> None:
"""Download a song, sleeping *delay* seconds before starting.

Expand Down
Loading