roadie/Roadie.Api.Library/Scrobble/ScrobblerIntegrationBase.cs

44 lines
1.3 KiB
C#
Raw Normal View History

using Microsoft.Extensions.Logging;
using Roadie.Library.Caching;
using Roadie.Library.Configuration;
2019-11-17 14:10:17 +00:00
using Roadie.Library.Data.Context;
using Roadie.Library.Models.Users;
using Roadie.Library.Utility;
using System.Threading.Tasks;
namespace Roadie.Library.Scrobble
{
public abstract class ScrobblerIntegrationBase : IScrobblerIntegration
{
protected ICacheManager CacheManager { get; }
2019-07-03 16:21:29 +00:00
protected IRoadieSettings Configuration { get; }
2019-07-03 16:21:29 +00:00
2019-11-17 14:10:17 +00:00
protected IRoadieDbContext DbContext { get; }
2019-07-03 16:21:29 +00:00
protected IHttpContext HttpContext { get; }
2019-07-03 16:21:29 +00:00
protected ILogger Logger { get; }
public abstract int SortOrder { get; }
public ScrobblerIntegrationBase(
IRoadieSettings configuration,
ILogger logger,
IRoadieDbContext dbContext,
ICacheManager cacheManager,
IHttpContext httpContext)
{
Logger = logger;
Configuration = configuration;
DbContext = dbContext;
CacheManager = cacheManager;
HttpContext = httpContext;
}
public abstract Task<OperationResult<bool>> NowPlaying(User roadieUser, ScrobbleInfo scrobble);
public abstract Task<OperationResult<bool>> Scrobble(User roadieUser, ScrobbleInfo scrobble);
}
}