feat(daemon): grab pipeline for wanted movies (#77)
This commit was merged in pull request #77.
This commit is contained in:
@@ -15,10 +15,13 @@ const MAX_SESSION_NEGOTIATIONS: usize = 4;
|
||||
const CONNECT_TIMEOUT: Duration = Duration::from_secs(5);
|
||||
const REQUEST_TIMEOUT: Duration = Duration::from_secs(30);
|
||||
|
||||
/// A magnet URI or the bytes of a `.torrent` file.
|
||||
/// Where Transmission is to get the torrent from.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum TorrentSource {
|
||||
Magnet(String),
|
||||
/// An HTTP link to a `.torrent`, fetched by Transmission itself. Indexer
|
||||
/// download links arrive in this form.
|
||||
Url(String),
|
||||
Metainfo(Vec<u8>),
|
||||
}
|
||||
|
||||
@@ -138,7 +141,9 @@ impl TransmissionClient {
|
||||
});
|
||||
|
||||
match request.source {
|
||||
TorrentSource::Magnet(uri) => arguments["filename"] = json!(uri),
|
||||
TorrentSource::Magnet(uri) | TorrentSource::Url(uri) => {
|
||||
arguments["filename"] = json!(uri);
|
||||
}
|
||||
TorrentSource::Metainfo(bytes) => {
|
||||
arguments["metainfo"] =
|
||||
json!(base64::engine::general_purpose::STANDARD.encode(bytes));
|
||||
|
||||
Reference in New Issue
Block a user