Update duplicate checking to allow for subtitles and mixed filetypes

This commit is contained in:
2012-06-16 14:37:18 +01:00
parent 85063df523
commit a3994f62e8
4 changed files with 60 additions and 13 deletions

View File

@@ -0,0 +1,20 @@
<?php
class DownloadDispatcher_Utility_MediaFile {
public static function isMediaFile($filename) {
return preg_match('/(?<!(?:\.|-)sample)\.(?:avi|ogm|m4v|mkv|mov|mp4|mpg|srt|smi|rar)$/i', $filename);
}
public static function isVideoFile($filename) {
return preg_match('/(?<!(?:\.|-)sample)\.(?:avi|ogm|m4v|mkv|mov|mp4|mpg)$/i', $filename);
}
public static function isMetadataFile($filename) {
return preg_match('/(?<!(?:\.|-)sample)\.(srt|smi)$/i', $filename);
}
}
?>