Reply to thread

[USER=76888]@kiwijunglist[/USER]

Try set "Max Filesize (MB) - If the filesize of the potential sample file is below this value it will be skipped." to large value, like 500 or bigger ... but:

[CODE=C#]long sampleMaxSize = MovingPicturesCore.Settings.MaxSampleFilesize * 1024 * 1024;

bool match = (file.Length < sampleMaxSize);

if(match){...[/CODE]

IMHO wrong logic :( I would have done so:

[CODE=C#]public static bool isSampleFile(FileInfo file) {

            try {

                // Create the sample filter regular expression

                Regex expr = new Regex(MovingPicturesCore.Settings.SampleRegExFilter, RegexOptions.IgnoreCase);

                // Set sample max size in bytes and check the file size

                long sampleMaxSize = MovingPicturesCore.Settings.MaxSampleFilesize * 1024 * 1024;

                bool match = (file.Length < sampleMaxSize);

                if (!match) {

                    // check the filename

                    match = expr.Match(file.Name).Success;

                    if (!match && MovingPicturesCore.Settings.SampleIncludeFolderName) {

                        // check the folder name if specified

                        match = expr.Match(file.DirectoryName).Success;

                    }

                }

                // Return result of given conditions 

                return match;

            }

            catch (Exception e) {

                if (e is ThreadAbortException)

                    throw e;

                logger.Warn("Sample file check failed: {0}", e.Message);

                return false;

            }

        }[/CODE]


Top Bottom