mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
32 lines
630 B
PHP
32 lines
630 B
PHP
<?php
|
|
|
|
namespace Gazelle\File;
|
|
|
|
class Torrent extends \Gazelle\File {
|
|
public function __construct(
|
|
public readonly int $id,
|
|
) {}
|
|
|
|
public function flush(): static {
|
|
return $this;
|
|
}
|
|
|
|
public function location(): string {
|
|
return "";
|
|
}
|
|
|
|
public function link(): string {
|
|
return "";
|
|
}
|
|
|
|
/**
|
|
* Path of a torrent file
|
|
*/
|
|
public function path(): string {
|
|
$key = strrev(sprintf('%04d', $this->id));
|
|
return sprintf('%s/%02d/%02d/%d.torrent',
|
|
STORAGE_PATH_TORRENT, substr($key, 0, 2), substr($key, 2, 2), $this->id
|
|
);
|
|
}
|
|
}
|