private bool ProcessFile(string FileName, bool isVideo, out string EncodedFileName, out string EncodedThumbnal, out long FileSize, string OriginalPath, string EncodedPath, string thumbnailSuffix)
        {
            string unprocessedKey = FileName;

            EncodedFileName = "";
            EncodedThumbnal = "";
            FileSize        = 0;

            try
            {
                //unprocessedKey = unprocessedKey.Substring(unprocessedKey.IndexOf("brtv-playlist-manager-playlists"));
                EncodedFileName = unprocessedKey.Replace(OriginalPath, EncodedPath);
                EncodedFileName = EncodedFileName.Replace("%20", " ");
                if (!isVideo)
                {
                    EncodedFileName = EncodedFileName.Replace(".png", ".jpg");
                }

                log.Info("Checking existance of file: " + EncodedFileName);
                if (!_s3Service.CheckObjectExists(EncodedFileName))
                //if (!_s3Service.CheckObjectExists(FileName))
                {
                    // don't include - wait for encoded file
                    log.Info("File: " + EncodedFileName + " does not exist");
                    return(false);
                }

                if (isVideo)
                {
                    EncodedThumbnal = unprocessedKey.Replace(OriginalPath, EncodedPath).Replace(".mp4", thumbnailSuffix + ".jpg");
                    EncodedThumbnal = EncodedThumbnal.Replace("%20", " ");
                    log.Info("Checking existance of thumbnail File: " + EncodedThumbnal);
                    if (!_s3Service.CheckObjectExists(EncodedThumbnal))
                    {
                        log.Info("thumbnail File: " + EncodedThumbnal + " doe not exist.");
                        return(false);
                    }
                }
                else
                {
                    EncodedThumbnal = FileName;
                }
                log.Info("Checking Size of File: " + EncodedFileName);
                FileSize = _s3Service.CheckFileSize(EncodedFileName);
            }
            catch
            {
                return(false);
            }
            return(true);
        }
        private bool ProcessFile(string FileName, bool isVideo, out string EncodedFileName, out string EncodedThumbnal, out long FileSize, string OriginalPath, string EncodedPath)
        {
            string unprocessedKey = FileName;

            EncodedFileName = "";
            EncodedThumbnal = "";
            FileSize        = 0;

            try
            {
                //unprocessedKey = unprocessedKey.Substring(unprocessedKey.IndexOf("brtv-playlist-manager-playlists"));
                EncodedFileName = unprocessedKey.Replace(OriginalPath, EncodedPath);
                EncodedFileName = EncodedFileName.Replace("%20", " ");
                if (!isVideo)
                {
                    EncodedFileName = EncodedFileName.Replace(".png", ".jpg");
                }

                if (!_s3Service.CheckObjectExists(EncodedFileName))
                //if (!_s3Service.CheckObjectExists(FileName))
                {
                    // don't include - wait for encoded file
                    return(false);
                }

                if (isVideo)
                {
                    EncodedThumbnal = unprocessedKey.Replace(OriginalPath, EncodedPath).Replace(".mp4", "_thumb.jpg");
                    EncodedThumbnal = EncodedThumbnal.Replace("%20", " ");
                    if (!_s3Service.CheckObjectExists(EncodedThumbnal))
                    {
                        return(false);
                    }
                }
                else
                {
                    EncodedThumbnal = FileName;
                }
                FileSize = _s3Service.CheckFileSize(EncodedFileName);
            }
            catch
            {
                return(false);
            }
            return(true);
        }