Exemplo n.º 1
0
        async Task <ISyncModel> AcquireEntryAsync(EntryData entry, CancellationToken token)
        {
            var fullPath = Path.Combine(ProjectFolder, m_FileOrganization == FileOrganization.OneFolderPerSource ? entry.SourceId : "",
                                        entry.Hash + PlayerFile.PersistentKeyToExtension(entry.IdInSource));

            return(await PlayerFile.LoadSyncModelAsync(fullPath, entry.IdInSource, token));
        }
        public Task <ISyncModel> GetSyncModelAsync(StreamKey streamKey, string hash)
        {
            // TODO Refactoring.
            // var fullPath = PlayerFile.GetFullPath(streamKey, hash);
            var downloadFolder = GetSourceProjectFolder(streamKey.source);
            var fullPath       = GetSyncModelFullPath(streamKey, hash);

            return(File.Exists(fullPath) ? PlayerFile.LoadSyncModelAsync(downloadFolder, streamKey.key, hash) : DownloadAndSave(streamKey, hash, fullPath));
        }
Exemplo n.º 3
0
 async Task <ISyncModel> AcquireEntryAsync(EntryData entry, CancellationToken token)
 {
     // Todo: add cancellationToken
     return(await PlayerFile.LoadSyncModelAsync(ProjectFolder, new PersistentKey(entry.EntryType, entry.IdInSource), entry.Hash));
 }
 public async Task <ISyncModel> GetSyncModelAsync(StreamKey streamKey, string hash)
 {
     return(await PlayerFile.LoadSyncModelAsync(m_DataFolder, streamKey.key, hash));
 }
Exemplo n.º 5
0
 async Task <ISyncModel> ReadLocalEntryAsync(EntryData entry, CancellationToken token)
 {
     // Todo: add cancellationToken
     return(await PlayerFile.LoadSyncModelAsync(GetSourceProjectFolder(entry.SourceId), new PersistentKey(entry.EntryType, entry.IdInSource), entry.Hash));
 }
        public async Task <ISyncModel> GetSyncModelAsync(StreamKey streamKey, string hash, CancellationToken token)
        {
            var fullPath = Path.Combine(m_DataFolder, hash + PlayerFile.PersistentKeyToExtension(streamKey.key));

            return(await PlayerFile.LoadSyncModelAsync(fullPath, streamKey.key, new CancellationToken()));
        }