示例#1
0
        public static bool CheckSettings(string database, UserInfo userInfo, string settingsTable, string connectionString)
        {
            string userID = userInfo.UserID.ToString();

            return(Peralatan.PeriksaDataDatabase(userID, "UserID", database, settingsTable, connectionString));
        }
        public static LogInformation GenerateLog(ProcessedVideoInformation videoInfo, VideoInformation processedVideoInformation, ProcessingInformation processingInfo, UserInformation userInfo, Requester requester)
        {
            #region Preparation
            DatabaseConfiguration configuration            = LoadDatabaseConfiguration();
            LogInformation        logInformation           = new LogInformation();
            FFmpegConfiguration   applicationConfiguration = LoadApplicationConfiguration();
            #endregion Preparation

            #region FFmpeg's log
            if (applicationConfiguration.useCustomFFmpeg)
            {
                logInformation.FFmpegLocation = applicationConfiguration.FFmpegLocation;
            }
            else
            {
                logInformation.FFmpegLocation = string.Empty;
            }
            #endregion FFmpeg's log

            #region FFProbe's log
            if (applicationConfiguration.useCustomFFProbe)
            {
                logInformation.FFProbeLocation = applicationConfiguration.FFProbeLocation;
            }
            else
            {
                logInformation.FFProbeLocation = string.Empty;
            }
            #endregion FFProbe's log

            #region Request time
            logInformation.requestTime  = processingInfo.processingStartTime;
            logInformation.finishedTime = processingInfo.processingEndTime;
            #endregion Request time

            #region UserID
            string userID = string.Empty;
            if (Peralatan.PeriksaDataDatabase(userInfo.UserSessionID, "SessionID", configuration.databaseName, configuration.userTableName, configuration.databaseConnectionString))
            {
                userID = Peralatan.MintaDataDatabase(configuration.databaseName, "UserID", configuration.userTableName, "SessionID", userInfo.UserSessionID, configuration.databaseConnectionString);
            }
            logInformation.userID = userID;
            #endregion UserID

            #region Processed video location
            logInformation.processedVideoLocation = videoInfo.target;
            #endregion Processed video location

            #region Delete original file
            logInformation.isDeleteWhenCompleteRequested = videoInfo.deleteOriginal;
            #endregion Delete original file

            #region Processing duration
            logInformation.totalProcessingDuration = processingInfo.totalVideoDuration;
            logInformation.audioProcessingDuration = processingInfo.processedAudioDuration;
            logInformation.videoProcessingDuration = processingInfo.processedVideoDuration;
            #endregion Processing duration

            #region Video information
            logInformation.originalVideoWidth  = processedVideoInformation.videoHeight;
            logInformation.originalVideoHeight = processedVideoInformation.videoHeight;
            logInformation.videoDuration       = processedVideoInformation.videoDuration;
            logInformation.scaledVideoWidth    = videoInfo.width;
            logInformation.scaledVideoHeight   = videoInfo.height;

            #endregion Video information
            return(logInformation);
        }
示例#3
0
 public static bool CheckUser(string database, string userTable, string sessionID, string connectionString)
 {
     return(Peralatan.PeriksaDataDatabase(sessionID, "SessionID", database, userTable, connectionString));
 }