﻿using System.Collections.Generic;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Driver;
using ShowFinder.Models;

namespace ShowFinder.Repositories.Interfaces
{
    public interface IMongoRepository
    {
        IMongoDatabase Database(string name);
        Task<BsonDocument> GetUserProfile(IMongoCollection<BsonDocument> userProfilesCollection, string hash);
        Task<bool> UpdateShows(IMongoCollection<BsonDocument> userProfilesCollection, string userHash, IEnumerable<string> showList);
        Task<bool> UpdateDownloadedEpisode(IMongoCollection<BsonDocument> userProfilesCollection, string profileId,
            string episodeId, string filteredShowName, DownloadedEpisode downloadedEpisodeData);
        Task<bool> DeleteDownloadedEpisode(IMongoCollection<BsonDocument> userProfilesCollection, string profileId,
            string episodeId, string filtereShowdName);
        Task<bool> UpdateTimeSpan(IMongoCollection<BsonDocument> userProfilesCollection, UserProfile profile);
        Task<BsonDocument> GetFromCache(IMongoCollection<BsonDocument> collection, string id);
        Task<bool> SetToCache(IMongoCollection<BsonDocument> collection, string id, BsonDocument doc, int daysToExpire);
    }
}