mirror of
https://github.com/OMGeeky/twba_downloader.git
synced 2025-12-26 16:27:25 +01:00
add max_items_to_process config to limit processing usage
This commit is contained in:
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -3000,8 +3000,8 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||
|
||||
[[package]]
|
||||
name = "twba-backup-config"
|
||||
version = "0.1.5"
|
||||
source = "git+https://github.com/OMGeeky/backup_config.git#c42b6fca97502bd3f590f78324cfc9437e5ce20d"
|
||||
version = "0.1.6"
|
||||
source = "git+https://github.com/OMGeeky/backup_config.git#60092672b4b45667ef21073b3c43c062715ce486"
|
||||
dependencies = [
|
||||
"confique",
|
||||
"serde",
|
||||
|
||||
@@ -3,9 +3,7 @@ use crate::twitch::TwitchClient;
|
||||
use std::path::Path;
|
||||
use twba_local_db::prelude::*;
|
||||
use twba_local_db::re_exports::sea_orm::ActiveValue::Set;
|
||||
use twba_local_db::re_exports::sea_orm::{
|
||||
ActiveModelTrait, ColumnTrait, DatabaseConnection, EntityTrait, IntoActiveModel, QueryFilter,
|
||||
};
|
||||
use twba_local_db::re_exports::sea_orm::{ActiveModelTrait, ColumnTrait, DatabaseConnection, EntityTrait, IntoActiveModel, QueryFilter, QuerySelect};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct DownloaderClient {
|
||||
@@ -24,6 +22,7 @@ impl DownloaderClient {
|
||||
Path::new(self.twitch_client.config.download_folder_path.as_str());
|
||||
let videos = Videos::find()
|
||||
.filter(VideosColumn::Status.eq(Status::NotStarted))
|
||||
.limit(self.twitch_client.config.max_items_to_process)
|
||||
.all(&self.db)
|
||||
.await?;
|
||||
info!("Found {} videos to download", videos.len());
|
||||
|
||||
Reference in New Issue
Block a user