2019-06-08 22:32:15 +00:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using Roadie.Library.Caching;
|
|
|
|
|
using Roadie.Library.Configuration;
|
|
|
|
|
using Roadie.Library.Models.Users;
|
2019-06-09 21:31:02 +00:00
|
|
|
|
using Roadie.Library.Utility;
|
2019-06-08 22:32:15 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using data = Roadie.Library.Data;
|
|
|
|
|
|
|
|
|
|
namespace Roadie.Library.Scrobble
|
|
|
|
|
{
|
|
|
|
|
public abstract class ScrobblerIntegrationBase : IScrobblerIntegration
|
|
|
|
|
{
|
|
|
|
|
protected ICacheManager CacheManager { get; }
|
|
|
|
|
protected IRoadieSettings Configuration { get; }
|
|
|
|
|
protected data.IRoadieDbContext DbContext { get; }
|
|
|
|
|
protected ILogger Logger { get; }
|
2019-06-09 21:31:02 +00:00
|
|
|
|
protected IHttpContext HttpContext { get; }
|
2019-06-08 22:32:15 +00:00
|
|
|
|
|
2019-06-09 21:31:02 +00:00
|
|
|
|
public ScrobblerIntegrationBase(IRoadieSettings configuration, ILogger logger, data.IRoadieDbContext dbContext,
|
|
|
|
|
ICacheManager cacheManager, IHttpContext httpContext)
|
2019-06-08 22:32:15 +00:00
|
|
|
|
{
|
|
|
|
|
Logger = logger;
|
|
|
|
|
Configuration = configuration;
|
|
|
|
|
DbContext = dbContext;
|
|
|
|
|
CacheManager = cacheManager;
|
2019-06-09 21:31:02 +00:00
|
|
|
|
HttpContext = httpContext;
|
2019-06-08 22:32:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public abstract Task<OperationResult<bool>> NowPlaying(User roadieUser, ScrobbleInfo scrobble);
|
|
|
|
|
|
|
|
|
|
public abstract Task<OperationResult<bool>> Scrobble(User roadieUser, ScrobbleInfo scrobble);
|
|
|
|
|
}
|
|
|
|
|
}
|