Skip to content

Commit

Permalink
core: exclude webm & hidden files
Browse files Browse the repository at this point in the history
ref: #108
  • Loading branch information
MSOB7YY committed Jan 13, 2024
1 parent 3700df0 commit 4c4471e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 31 deletions.
62 changes: 31 additions & 31 deletions lib/core/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const kDefaultDateTimeStrings = {
const Set<String> kAudioFileExtensions = {
'.m4a',
'.mp3',
'.webm',
'.weba',
'.ogg',
'.wav',
'.flac',
Expand Down Expand Up @@ -264,36 +264,36 @@ const Set<String> kAudioFileExtensions = {

/// Extensions used to filter video files
const Set<String> kVideoFilesExtensions = {
'mp4',
'mkv',
'avi',
'wmv',
'flv',
'mov',
'3gp',
'ogv',
'webm',
'mpg',
'mpeg',
'm4v',
'ts',
'vob',
'asf',
'rm',
'swf',
'f4v',
'divx',
'm2ts',
'mts',
'mpv',
'mp2',
'mpe',
'mpa',
'mxf',
'm2v',
'mpeg1',
'mpeg2',
'mpeg4'
'.mp4',
'.mkv',
'.avi',
'.wmv',
'.flv',
'.mov',
'.3gp',
'.ogv',
'.webm',
'.mpg',
'.mpeg',
'.m4v',
'.ts',
'.vob',
'.asf',
'.rm',
'.swf',
'.f4v',
'.divx',
'.m2ts',
'.mts',
'.mpv',
'.mp2',
'.mpe',
'.mpa',
'.mxf',
'.m2v',
'.mpeg1',
'.mpeg2',
'.mpeg4'
};

/// Extensions used to filter m3u files
Expand Down
5 changes: 5 additions & 0 deletions lib/core/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,15 @@ Map<String, Set<String>> getFilesTypeIsolate(Map parameters) {
for (final systemEntity in d.listSyncSafe()) {
if (systemEntity is File) {
final path = systemEntity.path;

// -- skip if hidden
if (path.startsWith('.')) continue;

// -- skip if not in extensions
if (!extensions.any((ext) => path.endsWith(ext))) {
continue;
}

// -- skip if in nomedia folder & specified to exclude
if (respectNoMedia && hasNoMedia) {
excludedByNoMedia.add(path);
Expand Down

0 comments on commit 4c4471e

Please sign in to comment.