Exemple #1
0
        public static bool Save(MongoCollectionManager_v1 <DownloadPostKey_v1, DownloadedFile_v2 <DownloadPostKey_v1> > mongoDownloadedFileManager, DownloadedFile_v2 <DownloadPostKey_v1> downloadedFile)
        {
            bool saved = false;

            if (mongoDownloadedFileManager.Load(downloadedFile.Key) == null)
            {
                downloadedFile.Id = mongoDownloadedFileManager.GetNewId();
                mongoDownloadedFileManager.Save(downloadedFile.Id, downloadedFile);
                saved = true;
            }
            //Trace.WriteLine("{0} : key {1}, file \"{2}\"", saved ? "saved    " : "not saved", downloadedFile.Key, downloadedFile.UncompressFiles != null ? downloadedFile.UncompressFiles.FirstOrDefault() : "null");
            Trace.WriteLine("{0} : key {1}, file \"{2}\"", saved ? "saved    " : "not saved", downloadedFile.Key,
                            downloadedFile.DownloadItemLinks != null ? downloadedFile.DownloadItemLinks.FirstOrDefault().ServerLinks.FirstOrDefault().FilePartLinks.FirstOrDefault().DownloadedFile : "null");
            return(true);
        }
Exemple #2
0
 public DownloadFile_v1 <TKey> GetQueueDownloadFile(TKey key)
 {
     return(_mongoQueueDownloadFileManager.Load(key));
 }
Exemple #3
0
 public DownloadedFile_v1 <TKey> GetDownloadedFile(TKey key)
 {
     return(_mongoDownloadedFileManager.Load(key));
 }