private string lastScrobbled; // Library ID of last scrobbled item // public static Scrobbler Instance; Instance = this public Scrobbler(IJsonSerializer json, ISessionManager sessionManager, ILogManager logManager, IHttpClient httpClient) { _json = json; _sessionManager = sessionManager; _logger = logManager.GetLogger("Simkl Scrobbler"); _api = new SimklApi(json, _logger, httpClient); nextScrobble = DateTime.Now; }
// public static Scrobbler Instance; Instance = this public Scrobbler(IJsonSerializer json, ISessionManager sessionManager, ILogManager logManager, IHttpClient httpClient, INotificationManager notifications) { _json = json; _sessionManager = sessionManager; _logger = logManager.GetLogger("Simkl Scrobbler"); _notifications = notifications; _api = new SimklApi(json, _logger, httpClient); lastScrobbled = new Dictionary <string, string>(); nextTry = DateTime.UtcNow; }
/// <summary> /// Initializes a new instance of the <see cref="PlaybackScrobbler"/> class. /// </summary> /// <param name="sessionManager">Instance of the <see cref="ISessionManager"/> interface.</param> /// <param name="logger">Instance of the <see cref="ILogger{Scrobbler}"/> interface.</param> /// <param name="simklApi">Instance of the <see cref="SimklApi"/>.</param> public PlaybackScrobbler( ISessionManager sessionManager, ILogger <PlaybackScrobbler> logger, SimklApi simklApi) { _sessionManager = sessionManager; _logger = logger; _simklApi = simklApi; _lastScrobbled = new Dictionary <string, Guid>(); _nextTry = DateTime.UtcNow; }
public void Dispose() { _sessionManager.PlaybackProgress -= embyPlaybackProgress; _api = null; }