feat: add the concept of tags

Tags are attached to all magnet links provided by a given source, and
passed to actions. This allows for e.g. better categorization in
Bitmagnet.
This commit is contained in:
Marc Plano-Lesay 2025-05-04 15:41:02 +10:00
parent f19e02988f
commit c3764c125a
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
13 changed files with 240 additions and 11 deletions

View file

@ -36,10 +36,11 @@ impl TransmissionClient {
}
/// Submit a magnet link to Transmission
pub async fn submit_magnet(&mut self, magnet: &str) -> Result<()> {
pub async fn submit_magnet(&mut self, magnet: &str, tags: Vec<&str>) -> Result<()> {
let args = TorrentAddArgs {
filename: Some(magnet.to_string()),
download_dir: Some(self.download_dir.clone()),
labels: Some(tags.iter().map(|t| t.to_string()).collect()),
..Default::default()
};