Files
ops-Gazelle/app/File/Torrent.php
2025-08-27 16:44:44 +02:00

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
);
}
}