Skip to content

Commit

Permalink
torrust#72: Constant added so you can easily adjust the value
Browse files Browse the repository at this point in the history
  • Loading branch information
alexohneander committed Jul 31, 2023
1 parent 7db0275 commit 1828883
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/torrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use crate::models::user::UserId;
use crate::tracker::statistics_importer::StatisticsImporter;
use crate::{tracker, AsCSV};

const MIN_TORRENT_TITLE_LENGTH: u32 = 3;

pub struct Index {
configuration: Arc<Configuration>,
tracker_statistics_importer: Arc<StatisticsImporter>,
Expand Down Expand Up @@ -104,7 +106,7 @@ impl Index {

torrent_request.torrent.set_announce_urls(&self.configuration).await;

if torrent_request.metadata.title.len() < 3 {
if torrent_request.metadata.title.len() < MIN_TORRENT_TITLE_LENGTH {
return Err(ServiceError::InvalidTorrentTitleLength);
}

Expand Down

0 comments on commit 1828883

Please sign in to comment.