Remove sample files from MediaFilesIterator
This commit is contained in:
@@ -2,7 +2,13 @@
|
|||||||
|
|
||||||
class DownloadDispatcher_Utility_MediaFilesIterator extends FilterIterator {
|
class DownloadDispatcher_Utility_MediaFilesIterator extends FilterIterator {
|
||||||
public function accept() {
|
public function accept() {
|
||||||
return preg_match('/(?<!\.sample)\.(?:avi|ogm|m4v|mkv|mov|mp4|mpg|srt|rar)$/i', $this->current()->getFilename());
|
$filename = $this->current()->getFilename();
|
||||||
|
if (preg_match('/^sample/', $filename)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (preg_match('/(?<!(?:\.|-)sample)\.(?:avi|ogm|m4v|mkv|mov|mp4|mpg|srt|rar)$/i', $filename)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user