protected override void InitializeRowSourceAndProcessRows(ExecutedQuery existingQuery)
 {
     if (m_processFromLiveDataReader)
     {
         base.InitializeRowSourceAndProcessRows(existingQuery);
         return;
     }
     InitializeBeforeProcessingRows(aReaderExtensionsSupported: false);
     m_odpContext.CheckAndThrowIfAborted();
     ProcessRows();
 }
        private static string GetFileName(ExecutedQuery executedQuery, Video video, SettingDownload settingDownload, int videoOrder)
        {
            var result = settingDownload.FileNameTemplate;

            result = result.Replace("{playlistName}", FileHelper.GetSafeFilename(executedQuery.Title));
            result = result.Replace("{playlistNumber}", FileHelper.GetSafeFilename(videoOrder.ToString()));
            result = result.Replace("{videoTitle}", FileHelper.GetSafeFilename(video.Title));
            result = Path.Combine(settingDownload.DownloadDirectory, result);

            return(result);
        }
示例#3
0
 protected override void InitializeRowSourceAndProcessRows(ExecutedQuery existingQuery)
 {
     if (this.m_processFromLiveDataReader)
     {
         base.InitializeRowSourceAndProcessRows(existingQuery);
     }
     else
     {
         this.InitializeBeforeProcessingRows(false);
         base.m_odpContext.CheckAndThrowIfAborted();
         base.ProcessRows();
     }
 }
        private static void Save_Videos(ExecutedQuery executedQuery, Settings settings, SettingDownload settingDownload)
        {
            Directory.CreateDirectory(settingDownload.DownloadDirectory);

            int videoOrder = 1;

            foreach (var video in executedQuery.Videos)
            {
                var fileName = GetFileName(executedQuery, video, settingDownload, videoOrder);
                if (!File.Exists(fileName))
                {
                    try
                    {
                        Save_Media(video.Id, settings, settingDownload, fileName);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine($"Save_Media. Exception: {ex.Message}");
                    }
                }
                videoOrder++;
            }
        }
示例#5
0
        internal IORMCollection <EntityType> Fetch(ORMEntity entity, long maxNumberOfItemsToReturn, Expression internalEntityJoinExpression = null)
        {
            var sqlBuilder = new SQLBuilder();

            sqlBuilder.BuildQuery(TableAttribute, SelectExpression, JoinExpression ?? InternalJoinExpression ?? internalEntityJoinExpression, WhereExpression ?? InternalWhereExpression, SortExpression, maxNumberOfItemsToReturn);

            if (ExecutedQuery.Equals(sqlBuilder.GeneratedQuery, StringComparison.InvariantCultureIgnoreCase))
            {
                return(this);
            }

            if (entity == null)
            {
                SQLExecuter.ExecuteCollectionQuery(this, sqlBuilder);
            }
            else
            {
                SQLExecuter.ExecuteEntityQuery(entity, sqlBuilder);
            }

            ExecutedQuery = sqlBuilder.GeneratedQuery;

            return(this);
        }