Example #1
0
        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;
        }
Example #2
0
 // 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;
 }
Example #3
0
 /// <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;
 }
Example #4
0
 public void Dispose()
 {
     _sessionManager.PlaybackProgress -= embyPlaybackProgress;
     _api = null;
 }