|
|
|
@ -32,14 +32,22 @@ class TorrentService
@@ -32,14 +32,22 @@ class TorrentService
|
|
|
|
|
// Tools |
|
|
|
|
public function readTorrentFileByFilepath( |
|
|
|
|
string $filepath |
|
|
|
|
): \Rhilip\Bencode\TorrentFile |
|
|
|
|
): ?\Rhilip\Bencode\TorrentFile |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
return \Rhilip\Bencode\TorrentFile::load( |
|
|
|
|
$filepath |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function readTorrentFileById( |
|
|
|
|
catch (\Rhilip\Bencode\ParseException $error) |
|
|
|
|
{ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function readTorrentFileByTorrentId( |
|
|
|
|
int $id |
|
|
|
|
): \Rhilip\Bencode\TorrentFile |
|
|
|
|
{ |
|
|
|
|