update event handlers

This commit is contained in:
Luke Pulverenti 2017-06-28 01:46:28 -04:00
parent 446461359f
commit 73544a4d72
7 changed files with 22 additions and 20 deletions

View File

@ -42,16 +42,16 @@
<Compile Include="SplittableProgressTests.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="MediaBrowser.Common, Version=3.2.1.111, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.0.695\lib\portable-net45+win8+wpa81\MediaBrowser.Common.dll</HintPath>
<Reference Include="MediaBrowser.Common, Version=3.2.19.6, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.0.703\lib\portable-net45+win8+wpa81\MediaBrowser.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MediaBrowser.Controller, Version=3.2.1.111, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Server.Core.3.0.695\lib\portable-net45+win8+wpa81\MediaBrowser.Controller.dll</HintPath>
<Reference Include="MediaBrowser.Controller, Version=3.2.19.6, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Server.Core.3.0.703\lib\portable-net45+win8+wpa81\MediaBrowser.Controller.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MediaBrowser.Model, Version=3.2.1.111, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.0.695\lib\portable-net45+win8+wpa81\MediaBrowser.Model.dll</HintPath>
<Reference Include="MediaBrowser.Model, Version=3.2.19.6, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.0.703\lib\portable-net45+win8+wpa81\MediaBrowser.Model.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.Common" version="3.0.695" targetFramework="portable45-net45+win8" />
<package id="MediaBrowser.Server.Core" version="3.0.695" targetFramework="portable45-net45+win8" />
<package id="MediaBrowser.Common" version="3.0.703" targetFramework="portable45-net45+win8" />
<package id="MediaBrowser.Server.Core" version="3.0.703" targetFramework="portable45-net45+win8" />
<package id="xunit" version="2.1.0" targetFramework="portable45-net45+win8" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="portable45-net45+win8" />
<package id="xunit.assert" version="2.1.0" targetFramework="portable45-net45+win8" />

View File

@ -2,7 +2,6 @@
using System.Globalization;
using System.Linq;
using System.Threading;
using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Entities;

View File

@ -113,7 +113,7 @@ namespace Trakt.Helpers
{
_traktApi.SendEpisodePlaystateUpdates(userPackage.UnSeenEpisodes, userPackage.TraktUser, false,
CancellationToken.None).ConfigureAwait(false);
userPackage.SeenEpisodes = new List<Episode>();
userPackage.UnSeenEpisodes = new List<Episode>();
}
userPackage.CurrentSeriesId = episode.Series.Id;

View File

@ -30,6 +30,7 @@ namespace Trakt
private TraktUriService _service;
private LibraryManagerEventsHelper _libraryManagerEventsHelper;
private readonly UserDataManagerEventsHelper _userDataManagerEventsHelper;
private IUserDataManager _userDataManager;
public static ServerMediator Instance { get; private set; }
@ -49,6 +50,7 @@ namespace Trakt
Instance = this;
_sessionManager = sessionManager;
_libraryManager = libraryManager;
_userDataManager = userDataManager;
_logger = logger.GetLogger("Trakt");
_traktApi = new TraktApi(jsonSerializer, _logger, httpClient, appHost, userDataManager, fileSystem);
@ -56,7 +58,6 @@ namespace Trakt
_libraryManagerEventsHelper = new LibraryManagerEventsHelper(_logger, _traktApi, timerFactory);
_userDataManagerEventsHelper = new UserDataManagerEventsHelper(_logger, _traktApi, timerFactory);
userDataManager.UserDataSaved += _userDataManager_UserDataSaved;
}
/// <summary>
@ -74,7 +75,7 @@ namespace Trakt
if (baseItem != null)
{
// determine if user has trakt credentials
var traktUser = UserHelper.GetTraktUser(e.UserId.ToString());
var traktUser = UserHelper.GetTraktUser(e.UserId);
// Can't progress
if (traktUser == null || !_traktApi.CanSync(baseItem, traktUser))
@ -92,6 +93,7 @@ namespace Trakt
/// </summary>
public void Run()
{
_userDataManager.UserDataSaved += _userDataManager_UserDataSaved;
_sessionManager.PlaybackStart += KernelPlaybackStart;
_sessionManager.PlaybackStopped += KernelPlaybackStopped;
_libraryManager.ItemAdded += LibraryManagerItemAdded;
@ -286,6 +288,7 @@ namespace Trakt
/// </summary>
public void Dispose()
{
_userDataManager.UserDataSaved -= _userDataManager_UserDataSaved;
_sessionManager.PlaybackStart -= KernelPlaybackStart;
_sessionManager.PlaybackStopped -= KernelPlaybackStopped;
_libraryManager.ItemAdded -= LibraryManagerItemAdded;

View File

@ -99,16 +99,16 @@
<EmbeddedResource Include="Configuration\configPage.html" />
</ItemGroup>
<ItemGroup>
<Reference Include="MediaBrowser.Common, Version=3.2.1.111, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.0.695\lib\portable-net45+win8+wpa81\MediaBrowser.Common.dll</HintPath>
<Reference Include="MediaBrowser.Common, Version=3.2.19.6, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.0.703\lib\portable-net45+win8+wpa81\MediaBrowser.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MediaBrowser.Controller, Version=3.2.1.111, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Server.Core.3.0.695\lib\portable-net45+win8+wpa81\MediaBrowser.Controller.dll</HintPath>
<Reference Include="MediaBrowser.Controller, Version=3.2.19.6, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Server.Core.3.0.703\lib\portable-net45+win8+wpa81\MediaBrowser.Controller.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MediaBrowser.Model, Version=3.2.1.111, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.0.695\lib\portable-net45+win8+wpa81\MediaBrowser.Model.dll</HintPath>
<Reference Include="MediaBrowser.Model, Version=3.2.19.6, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.0.703\lib\portable-net45+win8+wpa81\MediaBrowser.Model.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.Common" version="3.0.695" targetFramework="portable45-net45+win8" />
<package id="MediaBrowser.Server.Core" version="3.0.695" targetFramework="portable45-net45+win8" />
<package id="MediaBrowser.Common" version="3.0.703" targetFramework="portable45-net45+win8" />
<package id="MediaBrowser.Server.Core" version="3.0.703" targetFramework="portable45-net45+win8" />
</packages>