Prevent archives being extracted multiple times
This commit is contained in:
@@ -204,8 +204,8 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug
|
||||
foreach ($iterator as /** @var SplFileInfo */ $existing_file) {
|
||||
$existing_episode = $this->episode($existing_file->getFilename());
|
||||
if ($existing_episode == $episode) {
|
||||
// Only reject duplicates with the same extension, so we can keep meta data or high/low def copies
|
||||
if ($this->filetype($file) == $this->filetype($existing_file->getFilename())) {
|
||||
// Only reject duplicates for media files with the same extension, so we can keep meta data or high/low def copies
|
||||
if (DownloadDispatcher_Utility_MediaFile::isArchivefile($file) || $this->filetype($file) == $this->filetype($existing_file->getFilename())) {
|
||||
throw new DownloadDispatcher_Exception_DuplicateContent($file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,10 @@ class DownloadDispatcher_Utility_MediaFile {
|
||||
return preg_match('/(?<!(?:\.|-)sample)\.(srt|smi)$/i', $filename);
|
||||
}
|
||||
|
||||
public static function isArchiveFile($filename) {
|
||||
return preg_match('/(?<!(?:\.|-)sample)\.(rar)$/i', $filename);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user