1 Commits
Author SHA1 Message Date
itismadness 74929fdac8 Add 'hasFiles()' method for Gazelle upload check 2018-04-11 08:41:00 -04:00
2 changed files with 6 additions and 0 deletions

No files matched your search

+4
View File
@@ -449,6 +449,10 @@ class BencodeTorrent {
return $files;
}
public function hasFiles(): bool {
return isset($this->data['info']['files']);
}
/**
* Returns an array of strings formatted to be inserted into a Gazelle database into the table
* torrents.FileList which is then used for displaying the table of files to the user when
+2
View File
@@ -310,6 +310,7 @@ class BencodeTorrentTest extends TestCase {
['.mp3 s1234s 01 Test??.mp3 ÷', '.mp3 s2345s 03 Test.mp3 ÷'],
$bencode->getGazelleFileList()
);
$this->assertTrue($bencode->hasFiles());
}
public function testGetUtf8Name() {
@@ -340,6 +341,7 @@ class BencodeTorrentTest extends TestCase {
$bencode = new BencodeTorrent();
$bencode->setData($data);
$this->assertEquals(['.,!?)óÉ s1234s (test.,!?)óÉ ÷'], $bencode->getGazelleFileList());
$this->assertFalse($bencode->hasFiles());
}
/**