Update duplicate checking to allow for subtitles and mixed filetypes
This commit is contained in:
20
source/lib/DownloadDispatcher/Utility/MediaFile.class.php
Normal file
20
source/lib/DownloadDispatcher/Utility/MediaFile.class.php
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user