예제 #1
0
        public async Task EnsureMediaDatabaseExists(Guid userId)
        {
            var documentStore = _mediaStoreCache.GetEntry(userId);

            if (_databaseApi.DoesDatabaseExist(documentStore) == false)
            {
                await _databaseApi.CreateDatabase(documentStore);

                using (var dumpStream = GetMediaDump())
                {
                    await _databaseApi.ImportDump(documentStore, dumpStream);
                }
            }

            await UpdateDemoStats(documentStore);
        }