mirror of
https://github.com/jellyfin/jellyfin-plugin-trakt.git
synced 2024-11-22 21:30:14 +00:00
retarget to .net standard
This commit is contained in:
parent
4b26a6227d
commit
95ac3bb901
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<solution>
|
||||
<add key="disableSourceControlIntegration" value="true" />
|
||||
</solution>
|
||||
</configuration>
|
BIN
.nuget/NuGet.exe
BIN
.nuget/NuGet.exe
Binary file not shown.
@ -1,153 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
|
||||
|
||||
<!-- Enable the restore command to run before builds -->
|
||||
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
|
||||
|
||||
<!-- Property that enables building a package from a project -->
|
||||
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
|
||||
|
||||
<!-- Determines if package restore consent is required to restore packages -->
|
||||
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
|
||||
|
||||
<!-- Download NuGet.exe if it does not already exist -->
|
||||
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(PackageSources)' == '' ">
|
||||
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
|
||||
<!-- The official NuGet package source (https://nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
|
||||
<!--
|
||||
<PackageSource Include="https://nuget.org/api/v2/" />
|
||||
<PackageSource Include="https://my-nuget-source/nuget/" />
|
||||
-->
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
|
||||
<!-- Windows specific commands -->
|
||||
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
|
||||
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
|
||||
<PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
|
||||
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
|
||||
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
|
||||
<PackagesConfig>packages.config</PackagesConfig>
|
||||
<PackagesDir>$(SolutionDir)packages</PackagesDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- NuGet command -->
|
||||
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\nuget.exe</NuGetExePath>
|
||||
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
|
||||
|
||||
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
|
||||
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
|
||||
|
||||
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
|
||||
|
||||
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
|
||||
<!-- Commands -->
|
||||
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)"</RestoreCommand>
|
||||
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
|
||||
|
||||
<!-- We need to ensure packages are restored prior to assembly resolve -->
|
||||
<ResolveReferencesDependsOn Condition="$(RestorePackages) == 'true'">
|
||||
RestorePackages;
|
||||
$(ResolveReferencesDependsOn);
|
||||
</ResolveReferencesDependsOn>
|
||||
|
||||
<!-- Make the build depend on restore packages -->
|
||||
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
|
||||
$(BuildDependsOn);
|
||||
BuildPackage;
|
||||
</BuildDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CheckPrerequisites">
|
||||
<!-- Raise an error if we're unable to locate nuget.exe -->
|
||||
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
|
||||
<SetEnvironmentVariable EnvKey="VisualStudioVersion" EnvValue="$(VisualStudioVersion)" Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' " />
|
||||
<!--
|
||||
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
|
||||
This effectively acts as a lock that makes sure that the download operation will only happen once and all
|
||||
parallel builds will have to wait for it to complete.
|
||||
-->
|
||||
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_DownloadNuGet">
|
||||
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec Command="$(RestoreCommand)"
|
||||
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
||||
|
||||
<Exec Command="$(RestoreCommand)"
|
||||
LogStandardErrorAsError="true"
|
||||
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec Command="$(BuildCommand)"
|
||||
Condition=" '$(OS)' != 'Windows_NT' " />
|
||||
|
||||
<Exec Command="$(BuildCommand)"
|
||||
LogStandardErrorAsError="true"
|
||||
Condition=" '$(OS)' == 'Windows_NT' " />
|
||||
</Target>
|
||||
|
||||
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
||||
<ParameterGroup>
|
||||
<OutputFilename ParameterType="System.String" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Reference Include="System.Core" />
|
||||
<Using Namespace="System" />
|
||||
<Using Namespace="System.IO" />
|
||||
<Using Namespace="System.Net" />
|
||||
<Using Namespace="Microsoft.Build.Framework" />
|
||||
<Using Namespace="Microsoft.Build.Utilities" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
try {
|
||||
OutputFilename = Path.GetFullPath(OutputFilename);
|
||||
|
||||
Log.LogMessage("Downloading latest version of NuGet.exe...");
|
||||
WebClient webClient = new WebClient();
|
||||
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Log.LogErrorFromException(ex);
|
||||
return false;
|
||||
}
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
|
||||
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
||||
<ParameterGroup>
|
||||
<EnvKey ParameterType="System.String" Required="true" />
|
||||
<EnvValue ParameterType="System.String" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Using Namespace="System" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
try {
|
||||
Environment.SetEnvironmentVariable(EnvKey, EnvValue, System.EnvironmentVariableTarget.Process);
|
||||
}
|
||||
catch {
|
||||
}
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
</Project>
|
@ -1,3 +0,0 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("3.0.*")]
|
@ -1,30 +0,0 @@
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Trakt.Test")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Trakt.Test")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@ -1,59 +0,0 @@
|
||||
namespace Trakt.Test
|
||||
{
|
||||
using System;
|
||||
|
||||
using Trakt.Helpers;
|
||||
|
||||
using Xunit;
|
||||
|
||||
public class SplittableProgressTests
|
||||
{
|
||||
[Fact]
|
||||
public void AsIProgress()
|
||||
{
|
||||
IProgress<double> mainProg = new SplittableProgress(d => Assert.Equal(100, d));
|
||||
mainProg.Report(100);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtensionConversion()
|
||||
{
|
||||
IProgress<double> mainProg = new Progress<double>(d => Assert.Equal(100, d));
|
||||
mainProg.ToSplittableProgress().Report(100);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExtensionSplit()
|
||||
{
|
||||
IProgress<double> mainProg = new Progress<double>(d => Assert.Equal(25, d));
|
||||
mainProg.Split(4).Report(100);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Split()
|
||||
{
|
||||
var firstSplit = 3;
|
||||
var expected = 100d / firstSplit;
|
||||
|
||||
IProgress<double> mainProg = new Progress<double>(d => Assert.Equal(expected, d));
|
||||
ISplittableProgress<double> mainProgS = new SplittableProgress(mainProg.Report);
|
||||
var childProgS = mainProgS.Split(firstSplit);
|
||||
|
||||
childProgS.Report(100);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SplitTwice()
|
||||
{
|
||||
var firstSplit = 3;
|
||||
var secondSplit = 5;
|
||||
var expected = 100d / firstSplit / secondSplit;
|
||||
|
||||
IProgress<double> mainProg = new Progress<double>(d => Assert.Equal(expected, d));
|
||||
ISplittableProgress<double> mainProgS = new SplittableProgress(mainProg.Report);
|
||||
var grandchildProgS = mainProgS.Split(firstSplit).Split(secondSplit);
|
||||
|
||||
grandchildProgS.Report(100);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\xunit.runner.visualstudio.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.runner.visualstudio.props')" />
|
||||
<Import Project="..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{E26917D8-838E-40CF-BE87-2911B3096458}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Trakt.Test</RootNamespace>
|
||||
<AssemblyName>Trakt.Test</AssemblyName>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SplittableProgressTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MediaBrowser.Common, Version=3.2.28.7, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MediaBrowser.Common.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MediaBrowser.Controller, Version=3.2.28.7, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MediaBrowser.Server.Core.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Controller.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MediaBrowser.Model, Version=3.2.28.7, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MediaBrowser.Common.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Model.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\xunit.assert.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.assert.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\xunit.extensibility.core.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="xunit.execution.dotnet, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\xunit.extensibility.execution.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.execution.dotnet.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Trakt\Trakt.csproj">
|
||||
<Project>{7ffc306b-2680-49c7-8be0-6358b2a8a409}</Project>
|
||||
<Name>Trakt</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props'))" />
|
||||
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.runner.visualstudio.props'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MediaBrowser.Common" version="3.0.747" targetFramework="portable45-net45+win8" />
|
||||
<package id="MediaBrowser.Server.Core" version="3.0.747" 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" />
|
||||
<package id="xunit.core" version="2.1.0" targetFramework="portable45-net45+win8" />
|
||||
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="portable45-net45+win8" />
|
||||
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="portable45-net45+win8" />
|
||||
<package id="xunit.runner.console" version="2.1.0" targetFramework="portable45-net45+win8" />
|
||||
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="portable45-net45+win8" />
|
||||
</packages>
|
36
Trakt.sln
36
Trakt.sln
@ -1,41 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26730.3
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F17571BB-66D4-4DB5-8EC0-33A76DD5B018}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
SharedVersion.cs = SharedVersion.cs
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trakt", "Trakt\Trakt.csproj", "{7FFC306B-2680-49C7-8BE0-6358B2A8A409}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trakt.Test", "Trakt.Test\Trakt.Test.csproj", "{E26917D8-838E-40CF-BE87-2911B3096458}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trakt", "Trakt\Trakt.csproj", "{DF4A08DD-E803-4ADB-86D5-B572E5174BE3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7FFC306B-2680-49C7-8BE0-6358B2A8A409}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7FFC306B-2680-49C7-8BE0-6358B2A8A409}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7FFC306B-2680-49C7-8BE0-6358B2A8A409}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{7FFC306B-2680-49C7-8BE0-6358B2A8A409}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7FFC306B-2680-49C7-8BE0-6358B2A8A409}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7FFC306B-2680-49C7-8BE0-6358B2A8A409}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E26917D8-838E-40CF-BE87-2911B3096458}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E26917D8-838E-40CF-BE87-2911B3096458}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E26917D8-838E-40CF-BE87-2911B3096458}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{E26917D8-838E-40CF-BE87-2911B3096458}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{E26917D8-838E-40CF-BE87-2911B3096458}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E26917D8-838E-40CF-BE87-2911B3096458}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E26917D8-838E-40CF-BE87-2911B3096458}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E26917D8-838E-40CF-BE87-2911B3096458}.Release|x86.Build.0 = Release|Any CPU
|
||||
{DF4A08DD-E803-4ADB-86D5-B572E5174BE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DF4A08DD-E803-4ADB-86D5-B572E5174BE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DF4A08DD-E803-4ADB-86D5-B572E5174BE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DF4A08DD-E803-4ADB-86D5-B572E5174BE3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {B14022C2-FBC6-4B19-BD48-1ACFA236CD49}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -1,20 +1,14 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktEpisode
|
||||
{
|
||||
[DataMember(Name = "season", EmitDefaultValue = false)]
|
||||
public int? Season { get; set; }
|
||||
public int? season { get; set; }
|
||||
|
||||
[DataMember(Name = "number", EmitDefaultValue = false)]
|
||||
public int? Number { get; set; }
|
||||
public int? number { get; set; }
|
||||
|
||||
[DataMember(Name = "title", EmitDefaultValue = false)]
|
||||
public string Title { get; set; }
|
||||
public string title { get; set; }
|
||||
|
||||
[DataMember(Name = "ids")]
|
||||
public TraktEpisodeId Ids { get; set; }
|
||||
public TraktEpisodeId ids { get; set; }
|
||||
}
|
||||
}
|
@ -1,20 +1,14 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktEpisodeId : TraktId
|
||||
{
|
||||
[DataMember(Name = "imdb", EmitDefaultValue = false)]
|
||||
public string Imdb { get; set; }
|
||||
public string imdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tmdb", EmitDefaultValue = false)]
|
||||
public int? Tmdb { get; set; }
|
||||
public int? tmdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tvdb", EmitDefaultValue = false)]
|
||||
public int? Tvdb { get; set; }
|
||||
public int? tvdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tvrage", EmitDefaultValue = false)]
|
||||
public int? TvRage { get; set; }
|
||||
public int? tvrage { get; set; }
|
||||
}
|
||||
}
|
@ -1,14 +1,10 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktId
|
||||
{
|
||||
[DataMember(Name = "trakt", EmitDefaultValue = false)]
|
||||
public int? Trakt { get; set; }
|
||||
public int? trakt { get; set; }
|
||||
|
||||
[DataMember(Name = "slug", EmitDefaultValue = false)]
|
||||
public string Slug { get; set; }
|
||||
public string slug { get; set; }
|
||||
}
|
||||
}
|
@ -1,17 +1,12 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktMovie
|
||||
{
|
||||
[DataMember(Name = "title", EmitDefaultValue = false)]
|
||||
public string Title { get; set; }
|
||||
public string title { get; set; }
|
||||
|
||||
[DataMember(Name = "year", EmitDefaultValue = false)]
|
||||
public int? Year { get; set; }
|
||||
public int? year { get; set; }
|
||||
|
||||
[DataMember(Name = "ids")]
|
||||
public TraktMovieId Ids { get; set; }
|
||||
public TraktMovieId ids { get; set; }
|
||||
}
|
||||
}
|
@ -1,14 +1,10 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktMovieId : TraktId
|
||||
{
|
||||
[DataMember(Name = "imdb", EmitDefaultValue = false)]
|
||||
public string Imdb { get; set; }
|
||||
public string imdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tmdb", EmitDefaultValue = false)]
|
||||
public int? Tmdb { get; set; }
|
||||
public int? tmdb { get; set; }
|
||||
}
|
||||
}
|
@ -1,14 +1,10 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktPerson
|
||||
{
|
||||
[DataMember(Name = "name", EmitDefaultValue = false)]
|
||||
public string Name { get; set; }
|
||||
public string name { get; set; }
|
||||
|
||||
[DataMember(Name = "ids")]
|
||||
public TraktPersonId Ids { get; set; }
|
||||
public TraktPersonId ids { get; set; }
|
||||
}
|
||||
}
|
@ -1,17 +1,12 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktPersonId : TraktId
|
||||
{
|
||||
[DataMember(Name = "imdb")]
|
||||
public string ImdbId { get; set; }
|
||||
public string imdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tmdb")]
|
||||
public int? TmdbId { get; set; }
|
||||
public int? tmdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tvrage")]
|
||||
public int? TvRageId { get; set; }
|
||||
public int? tvrage { get; set; }
|
||||
}
|
||||
}
|
@ -1,14 +1,10 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public abstract class TraktRated
|
||||
{
|
||||
[DataMember(Name = "rating")]
|
||||
public int? Rating { get; set; }
|
||||
public int? rating { get; set; }
|
||||
|
||||
[DataMember(Name = "rated_at")]
|
||||
public string RatedAt { get; set; }
|
||||
public string rated_at { get; set; }
|
||||
}
|
||||
}
|
@ -1,14 +1,10 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktSeason
|
||||
{
|
||||
[DataMember(Name = "number", EmitDefaultValue = false)]
|
||||
public int? Number { get; set; }
|
||||
public int? number { get; set; }
|
||||
|
||||
[DataMember(Name = "ids")]
|
||||
public TraktSeasonId Ids { get; set; }
|
||||
public TraktSeasonId ids { get; set; }
|
||||
}
|
||||
}
|
@ -1,17 +1,12 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktSeasonId : TraktId
|
||||
{
|
||||
[DataMember(Name = "tmdb")]
|
||||
public int? Tmdb { get; set; }
|
||||
public int? tmdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tvdb")]
|
||||
public int? Tvdb { get; set; }
|
||||
public int? tvdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tvrage")]
|
||||
public int? TvRage { get; set; }
|
||||
public int? tvrage { get; set; }
|
||||
}
|
||||
}
|
@ -1,17 +1,12 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktShow
|
||||
{
|
||||
[DataMember(Name = "title", EmitDefaultValue = false)]
|
||||
public string Title { get; set; }
|
||||
public string title { get; set; }
|
||||
|
||||
[DataMember(Name = "year", EmitDefaultValue = false)]
|
||||
public int? Year { get; set; }
|
||||
public int? year { get; set; }
|
||||
|
||||
[DataMember(Name = "ids")]
|
||||
public TraktShowId Ids { get; set; }
|
||||
public TraktShowId ids { get; set; }
|
||||
}
|
||||
}
|
@ -1,20 +1,14 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktShowId : TraktId
|
||||
{
|
||||
[DataMember(Name = "imdb", EmitDefaultValue = false)]
|
||||
public string Imdb { get; set; }
|
||||
public string imdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tmdb", EmitDefaultValue = false)]
|
||||
public int? Tmdb { get; set; }
|
||||
public int? tmdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tvdb", EmitDefaultValue = false)]
|
||||
public int? Tvdb { get; set; }
|
||||
public int? tvdb { get; set; }
|
||||
|
||||
[DataMember(Name = "tvrage", EmitDefaultValue = false)]
|
||||
public int? TvRage { get; set; }
|
||||
public int? tvrage { get; set; }
|
||||
}
|
||||
}
|
@ -1,20 +1,14 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
namespace Trakt.Api.DataContracts.BaseModel
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktUserSummary
|
||||
{
|
||||
[DataMember(Name = "username")]
|
||||
public string Username { get; set; }
|
||||
public string username { get; set; }
|
||||
|
||||
[DataMember(Name = "name")]
|
||||
public string FullName { get; set; }
|
||||
public string name { get; set; }
|
||||
|
||||
[DataMember(Name = "vip")]
|
||||
public bool IsVip { get; set; }
|
||||
public bool vip { get; set; }
|
||||
|
||||
[DataMember(Name = "private")]
|
||||
public bool IsPrivate { get; set; }
|
||||
public bool @private { get; set; }
|
||||
}
|
||||
}
|
@ -1,39 +1,27 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Comments
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktComment
|
||||
{
|
||||
[DataMember(Name = "id")]
|
||||
public int Id { get; set; }
|
||||
public int id { get; set; }
|
||||
|
||||
[DataMember(Name = "parent_id")]
|
||||
public int? ParentId { get; set; }
|
||||
public int? parent_id { get; set; }
|
||||
|
||||
[DataMember(Name = "created_at")]
|
||||
public string CreatedAt { get; set; }
|
||||
public string created_at { get; set; }
|
||||
|
||||
[DataMember(Name = "comment")]
|
||||
public string Comment { get; set; }
|
||||
public string comment { get; set; }
|
||||
|
||||
[DataMember(Name = "spoiler")]
|
||||
public bool IsSpoiler { get; set; }
|
||||
public bool spoiler { get; set; }
|
||||
|
||||
[DataMember(Name = "review")]
|
||||
public bool IsReview { get; set; }
|
||||
public bool review { get; set; }
|
||||
|
||||
[DataMember(Name = "replies")]
|
||||
public int Replies { get; set; }
|
||||
public int replies { get; set; }
|
||||
|
||||
[DataMember(Name = "likes")]
|
||||
public int Likes { get; set; }
|
||||
public int likes { get; set; }
|
||||
|
||||
[DataMember(Name = "user_rating")]
|
||||
public int? UserRating { get; set; }
|
||||
public int? user_rating { get; set; }
|
||||
|
||||
[DataMember(Name = "user")]
|
||||
public TraktUserSummary User { get; set; }
|
||||
public TraktUserSummary user { get; set; }
|
||||
}
|
||||
}
|
@ -1,24 +1,17 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Scrobble
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktScrobbleEpisode
|
||||
{
|
||||
[DataMember(Name = "show", EmitDefaultValue = false)]
|
||||
public TraktShow Show { get; set; }
|
||||
public TraktShow show { get; set; }
|
||||
|
||||
[DataMember(Name = "episode")]
|
||||
public TraktEpisode Episode { get; set; }
|
||||
public TraktEpisode episode { get; set; }
|
||||
|
||||
[DataMember(Name = "progress")]
|
||||
public float Progress { get; set; }
|
||||
public float progress { get; set; }
|
||||
|
||||
[DataMember(Name = "app_version")]
|
||||
public string AppVersion { get; set; }
|
||||
public string app_version { get; set; }
|
||||
|
||||
[DataMember(Name = "app_date")]
|
||||
public string AppDate { get; set; }
|
||||
public string app_date { get; set; }
|
||||
}
|
||||
}
|
@ -1,21 +1,15 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Scrobble
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktScrobbleMovie
|
||||
{
|
||||
[DataMember(Name = "movie")]
|
||||
public TraktMovie Movie { get; set; }
|
||||
public TraktMovie movie { get; set; }
|
||||
|
||||
[DataMember(Name = "progress")]
|
||||
public float Progress { get; set; }
|
||||
public float progress { get; set; }
|
||||
|
||||
[DataMember(Name = "app_version")]
|
||||
public string AppVersion { get; set; }
|
||||
public string app_version { get; set; }
|
||||
|
||||
[DataMember(Name = "app_date")]
|
||||
public string AppDate { get; set; }
|
||||
public string app_date { get; set; }
|
||||
}
|
||||
}
|
@ -1,40 +1,28 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Scrobble
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktScrobbleResponse
|
||||
{
|
||||
[DataMember(Name = "action")]
|
||||
public string Action { get; set; }
|
||||
public string action { get; set; }
|
||||
|
||||
[DataMember(Name = "progress")]
|
||||
public float Progress { get; set; }
|
||||
public float progress { get; set; }
|
||||
|
||||
[DataMember(Name = "sharing")]
|
||||
public SocialMedia Sharing { get; set; }
|
||||
public SocialMedia sharing { get; set; }
|
||||
|
||||
[DataContract]
|
||||
public class SocialMedia
|
||||
{
|
||||
[DataMember(Name = "facebook")]
|
||||
public bool Facebook { get; set; }
|
||||
public bool facebook { get; set; }
|
||||
|
||||
[DataMember(Name = "twitter")]
|
||||
public bool Twitter { get; set; }
|
||||
public bool twitter { get; set; }
|
||||
|
||||
[DataMember(Name = "tumblr")]
|
||||
public bool Tumblr { get; set; }
|
||||
public bool tumblr { get; set; }
|
||||
}
|
||||
|
||||
[DataMember(Name = "movie")]
|
||||
public TraktMovie Movie { get; set; }
|
||||
public TraktMovie movie { get; set; }
|
||||
|
||||
[DataMember(Name = "episode")]
|
||||
public TraktEpisode Episode { get; set; }
|
||||
public TraktEpisode episode { get; set; }
|
||||
|
||||
[DataMember(Name = "show")]
|
||||
public TraktShow Show { get; set; }
|
||||
public TraktShow show { get; set; }
|
||||
}
|
||||
}
|
@ -1,27 +1,19 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync.Collection
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktEpisodeCollected : TraktEpisode
|
||||
{
|
||||
[DataMember(Name = "collected_at", EmitDefaultValue = false)]
|
||||
public string CollectedAt { get; set; }
|
||||
public string collected_at { get; set; }
|
||||
|
||||
[DataMember(Name = "media_type", EmitDefaultValue = false)]
|
||||
public string MediaType { get; set; }
|
||||
public string media_type { get; set; }
|
||||
|
||||
[DataMember(Name = "resolution", EmitDefaultValue = false)]
|
||||
public string Resolution { get; set; }
|
||||
public string resolution { get; set; }
|
||||
|
||||
[DataMember(Name = "audio", EmitDefaultValue = false)]
|
||||
public string Audio { get; set; }
|
||||
public string audio { get; set; }
|
||||
|
||||
[DataMember(Name = "audio_channels", EmitDefaultValue = false)]
|
||||
public string AudioChannels { get; set; }
|
||||
public string audio_channels { get; set; }
|
||||
|
||||
[DataMember(Name = "3d", EmitDefaultValue = false)]
|
||||
public bool Is3D { get; set; }
|
||||
//public bool 3d { get; set; }
|
||||
}
|
||||
}
|
@ -1,27 +1,19 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync.Collection
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktMovieCollected : TraktMovie
|
||||
{
|
||||
[DataMember(Name = "collected_at", EmitDefaultValue = false)]
|
||||
public string CollectedAt { get; set; }
|
||||
public string collected_at { get; set; }
|
||||
|
||||
[DataMember(Name = "media_type", EmitDefaultValue = false)]
|
||||
public string MediaType { get; set; }
|
||||
public string media_type { get; set; }
|
||||
|
||||
[DataMember(Name = "resolution", EmitDefaultValue = false)]
|
||||
public string Resolution { get; set; }
|
||||
public string resolution { get; set; }
|
||||
|
||||
[DataMember(Name = "audio", EmitDefaultValue = false)]
|
||||
public string Audio { get; set; }
|
||||
public string audio { get; set; }
|
||||
|
||||
[DataMember(Name = "audio_channels", EmitDefaultValue = false)]
|
||||
public string AudioChannels { get; set; }
|
||||
public string audio_channels { get; set; }
|
||||
|
||||
[DataMember(Name = "3d", EmitDefaultValue = false)]
|
||||
public bool Is3D { get; set; }
|
||||
//public bool 3d { get; set; }
|
||||
}
|
||||
}
|
@ -1,23 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync.Collection
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktShowCollected : TraktShow
|
||||
{
|
||||
[DataMember(Name = "seasons")]
|
||||
public List<TraktSeasonCollected> Seasons { get; set; }
|
||||
public List<TraktSeasonCollected> seasons { get; set; }
|
||||
|
||||
[DataContract]
|
||||
public class TraktSeasonCollected
|
||||
{
|
||||
[DataMember(Name = "number")]
|
||||
public int Number { get; set; }
|
||||
public int number { get; set; }
|
||||
|
||||
[DataMember(Name = "episodes")]
|
||||
public List<TraktEpisodeCollected> Episodes { get; set; }
|
||||
public List<TraktEpisodeCollected> episodes { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +1,11 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync.Ratings
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktEpisodeRated : TraktRated
|
||||
{
|
||||
[DataMember(Name = "number", EmitDefaultValue = false)]
|
||||
public int? Number { get; set; }
|
||||
public int? number { get; set; }
|
||||
|
||||
[DataMember(Name = "ids")]
|
||||
public TraktEpisodeId Ids { get; set; }
|
||||
public TraktEpisodeId ids { get; set; }
|
||||
}
|
||||
}
|
@ -1,18 +1,13 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync.Ratings
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktMovieRated : TraktRated
|
||||
{
|
||||
[DataMember(Name = "title", EmitDefaultValue = false)]
|
||||
public string Title { get; set; }
|
||||
public string title { get; set; }
|
||||
|
||||
[DataMember(Name = "year", EmitDefaultValue = false)]
|
||||
public int? Year { get; set; }
|
||||
public int? year { get; set; }
|
||||
|
||||
[DataMember(Name = "ids")]
|
||||
public TraktMovieId Ids { get; set; }
|
||||
public TraktMovieId ids { get; set; }
|
||||
}
|
||||
}
|
@ -1,31 +1,23 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync.Ratings
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktShowRated : TraktRated
|
||||
{
|
||||
[DataMember(Name = "title", EmitDefaultValue = false)]
|
||||
public string Title { get; set; }
|
||||
public string title { get; set; }
|
||||
|
||||
[DataMember(Name = "year", EmitDefaultValue = false)]
|
||||
public int? Year { get; set; }
|
||||
public int? year { get; set; }
|
||||
|
||||
[DataMember(Name = "ids")]
|
||||
public TraktShowId Ids { get; set; }
|
||||
public TraktShowId ids { get; set; }
|
||||
|
||||
[DataMember(Name = "seasons")]
|
||||
public List<TraktSeasonRated> Seasons { get; set; }
|
||||
public List<TraktSeasonRated> seasons { get; set; }
|
||||
|
||||
public class TraktSeasonRated : TraktRated
|
||||
{
|
||||
[DataMember(Name = "number")]
|
||||
public int? Number { get; set; }
|
||||
public int? number { get; set; }
|
||||
|
||||
[DataMember(Name = "episodes")]
|
||||
public List<TraktEpisodeRated> Episodes { get; set; }
|
||||
public List<TraktEpisodeRated> episodes { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -1,35 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.Sync.Collection;
|
||||
using Trakt.Api.DataContracts.Sync.Ratings;
|
||||
using Trakt.Api.DataContracts.Sync.Watched;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktSync<TMovie, TShow, TEpisode>
|
||||
{
|
||||
[DataMember(Name = "movies", EmitDefaultValue = false)]
|
||||
public List<TMovie> Movies { get; set; }
|
||||
public List<TMovie> movies { get; set; }
|
||||
|
||||
[DataMember(Name = "shows", EmitDefaultValue = false)]
|
||||
public List<TShow> Shows { get; set; }
|
||||
public List<TShow> shows { get; set; }
|
||||
|
||||
[DataMember(Name = "episodes", EmitDefaultValue = false)]
|
||||
public List<TEpisode> Episodes { get; set; }
|
||||
public List<TEpisode> episodes { get; set; }
|
||||
}
|
||||
|
||||
[DataContract]
|
||||
public class TraktSyncRated : TraktSync<TraktMovieRated, TraktShowRated, TraktEpisodeRated>
|
||||
{
|
||||
}
|
||||
|
||||
[DataContract]
|
||||
public class TraktSyncWatched : TraktSync<TraktMovieWatched, TraktShowWatched, TraktEpisodeWatched>
|
||||
{
|
||||
}
|
||||
|
||||
[DataContract]
|
||||
public class TraktSyncCollected : TraktSync<TraktMovieCollected, TraktShowCollected, TraktEpisodeCollected>
|
||||
{
|
||||
}
|
||||
|
@ -1,60 +1,42 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktSyncResponse
|
||||
{
|
||||
[DataMember(Name = "added")]
|
||||
public Items Added { get; set; }
|
||||
public Items added { get; set; }
|
||||
|
||||
[DataMember(Name = "deleted")]
|
||||
public Items Deleted { get; set; }
|
||||
public Items deleted { get; set; }
|
||||
|
||||
[DataMember(Name = "existing")]
|
||||
public Items Existing { get; set; }
|
||||
public Items existing { get; set; }
|
||||
|
||||
[DataContract]
|
||||
public class Items
|
||||
{
|
||||
[DataMember(Name = "movies")]
|
||||
public int Movies { get; set; }
|
||||
public int movies { get; set; }
|
||||
|
||||
[DataMember(Name = "shows")]
|
||||
public int Shows { get; set; }
|
||||
public int shows { get; set; }
|
||||
|
||||
[DataMember(Name = "seasons")]
|
||||
public int Seasons { get; set; }
|
||||
public int seasons { get; set; }
|
||||
|
||||
[DataMember(Name = "episodes")]
|
||||
public int Episodes { get; set; }
|
||||
public int episodes { get; set; }
|
||||
|
||||
[DataMember(Name = "people")]
|
||||
public int People { get; set; }
|
||||
public int people { get; set; }
|
||||
}
|
||||
|
||||
[DataMember(Name = "not_found")]
|
||||
public NotFoundObjects NotFound { get; set; }
|
||||
public NotFoundObjects not_found { get; set; }
|
||||
|
||||
[DataContract]
|
||||
public class NotFoundObjects
|
||||
{
|
||||
[DataMember(Name = "movies")]
|
||||
public List<TraktMovie> Movies { get; set; }
|
||||
public List<TraktMovie> movies { get; set; }
|
||||
|
||||
[DataMember(Name = "shows")]
|
||||
public List<TraktShow> Shows { get; set; }
|
||||
public List<TraktShow> shows { get; set; }
|
||||
|
||||
[DataMember(Name = "episodes")]
|
||||
public List<TraktEpisode> Episodes { get; set; }
|
||||
public List<TraktEpisode> episodes { get; set; }
|
||||
|
||||
[DataMember(Name = "seasons")]
|
||||
public List<TraktSeason> Seasons { get; set; }
|
||||
public List<TraktSeason> seasons { get; set; }
|
||||
|
||||
[DataMember(Name = "people")]
|
||||
public List<TraktPerson> People { get; set; }
|
||||
public List<TraktPerson> people { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync.Watched
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktEpisodeWatched : TraktEpisode
|
||||
{
|
||||
[DataMember(Name = "watched_at", EmitDefaultValue = false)]
|
||||
public string WatchedAt { get; set; }
|
||||
public string watched_at { get; set; }
|
||||
}
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync.Watched
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktMovieWatched : TraktMovie
|
||||
{
|
||||
[DataMember(Name = "watched_at", EmitDefaultValue = false)]
|
||||
public string WatchedAt { get; set; }
|
||||
public string watched_at { get; set; }
|
||||
}
|
||||
}
|
@ -1,16 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync.Watched
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktSeasonWatched : TraktSeason
|
||||
{
|
||||
[DataMember(Name = "watched_at", EmitDefaultValue = false)]
|
||||
public string WatchedAt { get; set; }
|
||||
public string watched_at { get; set; }
|
||||
|
||||
[DataMember(Name = "episodes")]
|
||||
public List<TraktEpisodeWatched> Episodes { get; set; }
|
||||
public List<TraktEpisodeWatched> episodes { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Sync.Watched
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktShowWatched : TraktShow
|
||||
{
|
||||
[DataMember(Name = "watched_at", EmitDefaultValue = false)]
|
||||
public string WatchedAt { get; set; }
|
||||
public string watched_at { get; set; }
|
||||
|
||||
[DataMember(Name = "seasons")]
|
||||
public List<TraktSeasonWatched> Seasons { get; set; }
|
||||
public List<TraktSeasonWatched> seasons { get; set; }
|
||||
}
|
||||
}
|
@ -1,11 +1,10 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
namespace Trakt.Api.DataContracts
|
||||
{
|
||||
[DataContract]
|
||||
|
||||
public class TraktUserToken
|
||||
{
|
||||
[DataMember(Name = "token")]
|
||||
public string Token { get; set; }
|
||||
public string token { get; set; }
|
||||
}
|
||||
}
|
@ -1,14 +1,12 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
namespace Trakt.Api.DataContracts
|
||||
{
|
||||
[DataContract]
|
||||
|
||||
public class TraktUserTokenRequest
|
||||
{
|
||||
[DataMember(Name = "login")]
|
||||
public string Login { get; set; }
|
||||
public string login { get; set; }
|
||||
|
||||
[DataMember(Name = "password")]
|
||||
public string Password { get; set; }
|
||||
public string password { get; set; }
|
||||
}
|
||||
}
|
@ -1,23 +1,17 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
namespace Trakt.Api.DataContracts.Users.Collection
|
||||
{
|
||||
[DataContract]
|
||||
public class TraktMetadata
|
||||
{
|
||||
[DataMember(Name = "media_type")]
|
||||
public string MediaType { get; set; }
|
||||
public string media_type { get; set; }
|
||||
|
||||
[DataMember(Name = "resolution")]
|
||||
public string Resolution { get; set; }
|
||||
public string resolution { get; set; }
|
||||
|
||||
[DataMember(Name = "audio")]
|
||||
public string Audio { get; set; }
|
||||
public string audio { get; set; }
|
||||
|
||||
[DataMember(Name = "audio_channels")]
|
||||
public string AudioChannels { get; set; }
|
||||
public string audio_channels { get; set; }
|
||||
|
||||
[DataMember(Name = "3d")]
|
||||
public bool Is3D { get; set; }
|
||||
//public bool 3d { get; set; }
|
||||
}
|
||||
}
|
@ -1,18 +1,15 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Users.Collection
|
||||
{
|
||||
[DataContract]
|
||||
|
||||
public class TraktMovieCollected
|
||||
{
|
||||
[DataMember(Name = "collected_at")]
|
||||
public string CollectedAt { get; set; }
|
||||
public string collected_at { get; set; }
|
||||
|
||||
[DataMember(Name = "metadata")]
|
||||
public TraktMetadata Metadata { get; set; }
|
||||
public TraktMetadata metadata { get; set; }
|
||||
|
||||
[DataMember(Name = "movie")]
|
||||
public TraktMovie Movie { get; set; }
|
||||
public TraktMovie movie { get; set; }
|
||||
}
|
||||
}
|
@ -1,41 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Users.Collection
|
||||
{
|
||||
[DataContract]
|
||||
|
||||
public class TraktShowCollected
|
||||
{
|
||||
[DataMember(Name = "last_collected_at")]
|
||||
public string LastCollectedAt { get; set; }
|
||||
public string last_collected_at { get; set; }
|
||||
|
||||
[DataMember(Name = "show")]
|
||||
public TraktShow Show { get; set; }
|
||||
public TraktShow show { get; set; }
|
||||
|
||||
[DataMember(Name = "seasons")]
|
||||
public List<TraktSeasonCollected> Seasons { get; set; }
|
||||
public List<TraktSeasonCollected> seasons { get; set; }
|
||||
|
||||
[DataContract]
|
||||
|
||||
public class TraktSeasonCollected
|
||||
{
|
||||
[DataMember(Name = "number")]
|
||||
public int Number { get; set; }
|
||||
public int number { get; set; }
|
||||
|
||||
[DataMember(Name = "episodes")]
|
||||
public List<TraktEpisodeCollected> Episodes { get; set; }
|
||||
public List<TraktEpisodeCollected> episodes { get; set; }
|
||||
|
||||
[DataContract]
|
||||
|
||||
public class TraktEpisodeCollected
|
||||
{
|
||||
[DataMember(Name = "number")]
|
||||
public int Number { get; set; }
|
||||
public int number { get; set; }
|
||||
|
||||
[DataMember(Name = "collected_at")]
|
||||
public string CollectedAt { get; set; }
|
||||
public string collected_at { get; set; }
|
||||
|
||||
[DataMember(Name = "metadata")]
|
||||
public TraktMetadata Metadata { get; set; }
|
||||
public TraktMetadata metadata { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Users.Ratings
|
||||
{
|
||||
[DataContract]
|
||||
|
||||
public class TraktEpisodeRated : TraktRated
|
||||
{
|
||||
[DataMember(Name = "episode")]
|
||||
public TraktEpisode Episode { get; set; }
|
||||
public TraktEpisode episode { get; set; }
|
||||
}
|
||||
}
|
@ -1,12 +1,11 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Users.Ratings
|
||||
{
|
||||
[DataContract]
|
||||
|
||||
public class TraktMovieRated : TraktRated
|
||||
{
|
||||
[DataMember(Name = "movie")]
|
||||
public TraktMovie Movie { get; set; }
|
||||
public TraktMovie movie { get; set; }
|
||||
}
|
||||
}
|
@ -1,12 +1,11 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Users.Ratings
|
||||
{
|
||||
[DataContract]
|
||||
|
||||
public class TraktSeasonRated : TraktRated
|
||||
{
|
||||
[DataMember(Name = "season")]
|
||||
public TraktSeason Season { get; set; }
|
||||
public TraktSeason season { get; set; }
|
||||
}
|
||||
}
|
@ -1,12 +1,11 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Users.Ratings
|
||||
{
|
||||
[DataContract]
|
||||
|
||||
public class TraktShowRated : TraktRated
|
||||
{
|
||||
[DataMember(Name = "show")]
|
||||
public TraktShow Show { get; set; }
|
||||
public TraktShow show { get; set; }
|
||||
}
|
||||
}
|
@ -1,18 +1,15 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Users.Watched
|
||||
{
|
||||
[DataContract]
|
||||
|
||||
public class TraktMovieWatched
|
||||
{
|
||||
[DataMember(Name = "plays")]
|
||||
public int Plays { get; set; }
|
||||
public int plays { get; set; }
|
||||
|
||||
[DataMember(Name = "last_watched_at")]
|
||||
public string LastWatchedAt { get; set; }
|
||||
public string last_watched_at { get; set; }
|
||||
|
||||
[DataMember(Name = "movie")]
|
||||
public TraktMovie Movie { get; set; }
|
||||
public TraktMovie movie { get; set; }
|
||||
}
|
||||
}
|
@ -1,41 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
using Trakt.Api.DataContracts.BaseModel;
|
||||
|
||||
namespace Trakt.Api.DataContracts.Users.Watched
|
||||
{
|
||||
[DataContract]
|
||||
|
||||
public class TraktShowWatched
|
||||
{
|
||||
[DataMember(Name = "plays")]
|
||||
public int Plays { get; set; }
|
||||
public int plays { get; set; }
|
||||
|
||||
[DataMember(Name = "last_watched_at")]
|
||||
public string WatchedAt { get; set; }
|
||||
public string last_watched_at { get; set; }
|
||||
|
||||
[DataMember(Name = "show")]
|
||||
public TraktShow Show { get; set; }
|
||||
public TraktShow show { get; set; }
|
||||
|
||||
[DataMember(Name = "seasons")]
|
||||
public List<Season> Seasons { get; set; }
|
||||
public List<Season> seasons { get; set; }
|
||||
|
||||
[DataContract]
|
||||
|
||||
public class Season
|
||||
{
|
||||
[DataMember(Name = "number")]
|
||||
public int Number { get; set; }
|
||||
public int number { get; set; }
|
||||
|
||||
[DataMember(Name = "episodes")]
|
||||
public List<Episode> Episodes { get; set; }
|
||||
public List<Episode> episodes { get; set; }
|
||||
|
||||
[DataContract]
|
||||
|
||||
public class Episode
|
||||
{
|
||||
[DataMember(Name = "number")]
|
||||
public int Number { get; set; }
|
||||
public int number { get; set; }
|
||||
|
||||
[DataMember(Name = "plays")]
|
||||
public int Plays { get; set; }
|
||||
public int plays { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,17 +109,17 @@ namespace Trakt.Api
|
||||
{
|
||||
var movieData = new TraktScrobbleMovie
|
||||
{
|
||||
AppDate = DateTime.Today.ToString("yyyy-MM-dd"),
|
||||
AppVersion = _appHost.ApplicationVersion.ToString(),
|
||||
Progress = progressPercent,
|
||||
Movie = new TraktMovie
|
||||
app_date = DateTime.Today.ToString("yyyy-MM-dd"),
|
||||
app_version = _appHost.ApplicationVersion.ToString(),
|
||||
progress = progressPercent,
|
||||
movie = new TraktMovie
|
||||
{
|
||||
Title = movie.Name,
|
||||
Year = movie.ProductionYear,
|
||||
Ids = new TraktMovieId
|
||||
title = movie.Name,
|
||||
year = movie.ProductionYear,
|
||||
ids = new TraktMovieId
|
||||
{
|
||||
Imdb = movie.GetProviderId(MetadataProviders.Imdb),
|
||||
Tmdb = movie.GetProviderId(MetadataProviders.Tmdb).ConvertToInt()
|
||||
imdb = movie.GetProviderId(MetadataProviders.Imdb),
|
||||
tmdb = movie.GetProviderId(MetadataProviders.Tmdb).ConvertToInt()
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -162,14 +162,14 @@ namespace Trakt.Api
|
||||
{
|
||||
episodeDatas.Add(new TraktScrobbleEpisode
|
||||
{
|
||||
AppDate = DateTime.Today.ToString("yyyy-MM-dd"),
|
||||
AppVersion = _appHost.ApplicationVersion.ToString(),
|
||||
Progress = progressPercent,
|
||||
Episode = new TraktEpisode
|
||||
app_date = DateTime.Today.ToString("yyyy-MM-dd"),
|
||||
app_version = _appHost.ApplicationVersion.ToString(),
|
||||
progress = progressPercent,
|
||||
episode = new TraktEpisode
|
||||
{
|
||||
Ids = new TraktEpisodeId
|
||||
ids = new TraktEpisodeId
|
||||
{
|
||||
Tvdb = tvDbId.ConvertToInt()
|
||||
tvdb = tvDbId.ConvertToInt()
|
||||
},
|
||||
}
|
||||
});
|
||||
@ -183,23 +183,23 @@ namespace Trakt.Api
|
||||
{
|
||||
episodeDatas.Add(new TraktScrobbleEpisode
|
||||
{
|
||||
AppDate = DateTime.Today.ToString("yyyy-MM-dd"),
|
||||
AppVersion = _appHost.ApplicationVersion.ToString(),
|
||||
Progress = progressPercent,
|
||||
Episode = new TraktEpisode
|
||||
app_date = DateTime.Today.ToString("yyyy-MM-dd"),
|
||||
app_version = _appHost.ApplicationVersion.ToString(),
|
||||
progress = progressPercent,
|
||||
episode = new TraktEpisode
|
||||
{
|
||||
Season = episode.GetSeasonNumber(),
|
||||
Number = number
|
||||
season = episode.GetSeasonNumber(),
|
||||
number = number
|
||||
},
|
||||
Show = new TraktShow
|
||||
show = new TraktShow
|
||||
{
|
||||
Title = episode.Series.Name,
|
||||
Year = episode.Series.ProductionYear,
|
||||
Ids = new TraktShowId
|
||||
title = episode.Series.Name,
|
||||
year = episode.Series.ProductionYear,
|
||||
ids = new TraktShowId
|
||||
{
|
||||
Tvdb = episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt(),
|
||||
Imdb = episode.Series.GetProviderId(MetadataProviders.Imdb),
|
||||
TvRage = episode.Series.GetProviderId(MetadataProviders.TvRage).ConvertToInt()
|
||||
tvdb = episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt(),
|
||||
imdb = episode.Series.GetProviderId(MetadataProviders.Imdb),
|
||||
tvrage = episode.Series.GetProviderId(MetadataProviders.TvRage).ConvertToInt()
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -253,21 +253,21 @@ namespace Trakt.Api
|
||||
var audioStream = m.GetMediaStreams().FirstOrDefault(x => x.Type == MediaStreamType.Audio);
|
||||
var traktMovieCollected = new TraktMovieCollected
|
||||
{
|
||||
CollectedAt = m.DateCreated.ToISO8601(),
|
||||
Title = m.Name,
|
||||
Year = m.ProductionYear,
|
||||
Ids = new TraktMovieId
|
||||
collected_at = m.DateCreated.ToISO8601(),
|
||||
title = m.Name,
|
||||
year = m.ProductionYear,
|
||||
ids = new TraktMovieId
|
||||
{
|
||||
Imdb = m.GetProviderId(MetadataProviders.Imdb),
|
||||
Tmdb = m.GetProviderId(MetadataProviders.Tmdb).ConvertToInt()
|
||||
imdb = m.GetProviderId(MetadataProviders.Imdb),
|
||||
tmdb = m.GetProviderId(MetadataProviders.Tmdb).ConvertToInt()
|
||||
}
|
||||
};
|
||||
if (traktUser.ExportMediaInfo)
|
||||
{
|
||||
traktMovieCollected.Is3D = m.Is3D;
|
||||
traktMovieCollected.AudioChannels = audioStream.GetAudioChannels();
|
||||
traktMovieCollected.Audio = audioStream.GetCodecRepresetation();
|
||||
traktMovieCollected.Resolution = m.GetDefaultVideoStream().GetResolution();
|
||||
//traktMovieCollected.Is3D = m.Is3D;
|
||||
traktMovieCollected.audio_channels = audioStream.GetAudioChannels();
|
||||
traktMovieCollected.audio = audioStream.GetCodecRepresetation();
|
||||
traktMovieCollected.resolution = m.GetDefaultVideoStream().GetResolution();
|
||||
}
|
||||
return traktMovieCollected;
|
||||
}).ToList();
|
||||
@ -279,7 +279,7 @@ namespace Trakt.Api
|
||||
{
|
||||
var data = new TraktSyncCollected
|
||||
{
|
||||
Movies = chunk.ToList()
|
||||
movies = chunk.ToList()
|
||||
};
|
||||
using (var response = await PostToTrakt(url, data, cancellationToken, traktUser))
|
||||
{
|
||||
@ -334,18 +334,18 @@ namespace Trakt.Api
|
||||
{
|
||||
var traktEpisodeCollected = new TraktEpisodeCollected
|
||||
{
|
||||
CollectedAt = episode.DateCreated.ToISO8601(),
|
||||
Ids = new TraktEpisodeId
|
||||
collected_at = episode.DateCreated.ToISO8601(),
|
||||
ids = new TraktEpisodeId
|
||||
{
|
||||
Tvdb = tvDbId.ConvertToInt()
|
||||
tvdb = tvDbId.ConvertToInt()
|
||||
}
|
||||
};
|
||||
if (traktUser.ExportMediaInfo)
|
||||
{
|
||||
traktEpisodeCollected.Is3D = episode.Is3D;
|
||||
traktEpisodeCollected.AudioChannels = audioStream.GetAudioChannels();
|
||||
traktEpisodeCollected.Audio = audioStream.GetCodecRepresetation();
|
||||
traktEpisodeCollected.Resolution = episode.GetDefaultVideoStream().GetResolution();
|
||||
//traktEpisodeCollected.Is3D = episode.Is3D;
|
||||
traktEpisodeCollected.audio_channels = audioStream.GetAudioChannels();
|
||||
traktEpisodeCollected.audio = audioStream.GetCodecRepresetation();
|
||||
traktEpisodeCollected.resolution = episode.GetDefaultVideoStream().GetResolution();
|
||||
}
|
||||
episodesPayload.Add(traktEpisodeCollected);
|
||||
}
|
||||
@ -356,32 +356,32 @@ namespace Trakt.Api
|
||||
var syncShow =
|
||||
showPayload.FirstOrDefault(
|
||||
sre =>
|
||||
sre.Ids != null &&
|
||||
sre.Ids.Tvdb == episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt());
|
||||
sre.ids != null &&
|
||||
sre.ids.tvdb == episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt());
|
||||
if (syncShow == null)
|
||||
{
|
||||
syncShow = new TraktShowCollected
|
||||
{
|
||||
Ids = new TraktShowId
|
||||
ids = new TraktShowId
|
||||
{
|
||||
Tvdb = episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt(),
|
||||
Imdb = episode.Series.GetProviderId(MetadataProviders.Imdb),
|
||||
TvRage = episode.Series.GetProviderId(MetadataProviders.TvRage).ConvertToInt()
|
||||
tvdb = episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt(),
|
||||
imdb = episode.Series.GetProviderId(MetadataProviders.Imdb),
|
||||
tvrage = episode.Series.GetProviderId(MetadataProviders.TvRage).ConvertToInt()
|
||||
},
|
||||
Seasons = new List<TraktShowCollected.TraktSeasonCollected>()
|
||||
seasons = new List<TraktShowCollected.TraktSeasonCollected>()
|
||||
};
|
||||
showPayload.Add(syncShow);
|
||||
}
|
||||
var syncSeason =
|
||||
syncShow.Seasons.FirstOrDefault(ss => ss.Number == episode.GetSeasonNumber());
|
||||
syncShow.seasons.FirstOrDefault(ss => ss.number == episode.GetSeasonNumber());
|
||||
if (syncSeason == null)
|
||||
{
|
||||
syncSeason = new TraktShowCollected.TraktSeasonCollected
|
||||
{
|
||||
Number = episode.GetSeasonNumber(),
|
||||
Episodes = new List<TraktEpisodeCollected>()
|
||||
number = episode.GetSeasonNumber(),
|
||||
episodes = new List<TraktEpisodeCollected>()
|
||||
};
|
||||
syncShow.Seasons.Add(syncSeason);
|
||||
syncShow.seasons.Add(syncSeason);
|
||||
}
|
||||
for (var number = indexNumber; number <= finalNumber; number++)
|
||||
{
|
||||
@ -390,31 +390,31 @@ namespace Trakt.Api
|
||||
if (number == indexNumber)
|
||||
{
|
||||
// Omit this from the rest because then we end up attaching the tvdb of the first episode to the subsequent ones
|
||||
ids.Tvdb = tvDbId.ConvertToInt();
|
||||
ids.tvdb = tvDbId.ConvertToInt();
|
||||
|
||||
}
|
||||
var traktEpisodeCollected = new TraktEpisodeCollected
|
||||
{
|
||||
Number = number,
|
||||
CollectedAt = episode.DateCreated.ToISO8601(),
|
||||
Ids = ids
|
||||
number = number,
|
||||
collected_at = episode.DateCreated.ToISO8601(),
|
||||
ids = ids
|
||||
};
|
||||
if (traktUser.ExportMediaInfo)
|
||||
{
|
||||
traktEpisodeCollected.Is3D = episode.Is3D;
|
||||
traktEpisodeCollected.AudioChannels = audioStream.GetAudioChannels();
|
||||
traktEpisodeCollected.Audio = audioStream.GetCodecRepresetation();
|
||||
traktEpisodeCollected.Resolution = episode.GetDefaultVideoStream().GetResolution();
|
||||
//traktEpisodeCollected.Is3D = episode.Is3D;
|
||||
traktEpisodeCollected.audio_channels = audioStream.GetAudioChannels();
|
||||
traktEpisodeCollected.audio = audioStream.GetCodecRepresetation();
|
||||
traktEpisodeCollected.resolution = episode.GetDefaultVideoStream().GetResolution();
|
||||
}
|
||||
syncSeason.Episodes.Add(traktEpisodeCollected);
|
||||
syncSeason.episodes.Add(traktEpisodeCollected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var data = new TraktSyncCollected
|
||||
{
|
||||
Episodes = episodesPayload.ToList(),
|
||||
Shows = showPayload.ToList()
|
||||
episodes = episodesPayload.ToList(),
|
||||
shows = showPayload.ToList()
|
||||
};
|
||||
|
||||
var url = eventType == EventType.Add ? TraktUris.SyncCollectionAdd : TraktUris.SyncCollectionRemove;
|
||||
@ -447,20 +447,20 @@ namespace Trakt.Api
|
||||
{
|
||||
new TraktShowCollected
|
||||
{
|
||||
Title = show.Name,
|
||||
Year = show.ProductionYear,
|
||||
Ids = new TraktShowId
|
||||
title = show.Name,
|
||||
year = show.ProductionYear,
|
||||
ids = new TraktShowId
|
||||
{
|
||||
Tvdb = show.GetProviderId(MetadataProviders.Tvdb).ConvertToInt(),
|
||||
Imdb = show.GetProviderId(MetadataProviders.Imdb),
|
||||
TvRage = show.GetProviderId(MetadataProviders.TvRage).ConvertToInt()
|
||||
tvdb = show.GetProviderId(MetadataProviders.Tvdb).ConvertToInt(),
|
||||
imdb = show.GetProviderId(MetadataProviders.Imdb),
|
||||
tvrage = show.GetProviderId(MetadataProviders.TvRage).ConvertToInt()
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
var data = new TraktSyncCollected
|
||||
{
|
||||
Shows = showPayload.ToList()
|
||||
shows = showPayload.ToList()
|
||||
};
|
||||
|
||||
var url = eventType == EventType.Add ? TraktUris.SyncCollectionAdd : TraktUris.SyncCollectionRemove;
|
||||
@ -490,14 +490,14 @@ namespace Trakt.Api
|
||||
{
|
||||
new TraktMovieRated
|
||||
{
|
||||
Title = item.Name,
|
||||
Year = item.ProductionYear,
|
||||
Ids = new TraktMovieId
|
||||
title = item.Name,
|
||||
year = item.ProductionYear,
|
||||
ids = new TraktMovieId
|
||||
{
|
||||
Imdb = item.GetProviderId(MetadataProviders.Imdb),
|
||||
Tmdb = item.GetProviderId(MetadataProviders.Tmdb).ConvertToInt()
|
||||
imdb = item.GetProviderId(MetadataProviders.Imdb),
|
||||
tmdb = item.GetProviderId(MetadataProviders.Tmdb).ConvertToInt()
|
||||
},
|
||||
Rating = rating
|
||||
rating = rating
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -514,23 +514,23 @@ namespace Trakt.Api
|
||||
var indexNumber = episode.IndexNumber.Value;
|
||||
var show = new TraktShowRated
|
||||
{
|
||||
Ids = new TraktShowId
|
||||
ids = new TraktShowId
|
||||
{
|
||||
Tvdb = episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt(),
|
||||
Imdb = episode.Series.GetProviderId(MetadataProviders.Imdb),
|
||||
TvRage = episode.Series.GetProviderId(MetadataProviders.TvRage).ConvertToInt()
|
||||
tvdb = episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt(),
|
||||
imdb = episode.Series.GetProviderId(MetadataProviders.Imdb),
|
||||
tvrage = episode.Series.GetProviderId(MetadataProviders.TvRage).ConvertToInt()
|
||||
},
|
||||
Seasons = new List<TraktShowRated.TraktSeasonRated>
|
||||
seasons = new List<TraktShowRated.TraktSeasonRated>
|
||||
{
|
||||
new TraktShowRated.TraktSeasonRated
|
||||
{
|
||||
Number = episode.GetSeasonNumber(),
|
||||
Episodes = new List<TraktEpisodeRated>
|
||||
number = episode.GetSeasonNumber(),
|
||||
episodes = new List<TraktEpisodeRated>
|
||||
{
|
||||
new TraktEpisodeRated
|
||||
{
|
||||
Number = indexNumber,
|
||||
Rating = rating
|
||||
number = indexNumber,
|
||||
rating = rating
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -553,10 +553,10 @@ namespace Trakt.Api
|
||||
{
|
||||
new TraktEpisodeRated
|
||||
{
|
||||
Rating = rating,
|
||||
Ids = new TraktEpisodeId
|
||||
rating = rating,
|
||||
ids = new TraktEpisodeId
|
||||
{
|
||||
Tvdb = episode.GetProviderId(MetadataProviders.Tvdb).ConvertToInt()
|
||||
tvdb = episode.GetProviderId(MetadataProviders.Tvdb).ConvertToInt()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -571,13 +571,13 @@ namespace Trakt.Api
|
||||
{
|
||||
new TraktShowRated
|
||||
{
|
||||
Rating = rating,
|
||||
Title = item.Name,
|
||||
Year = item.ProductionYear,
|
||||
Ids = new TraktShowId
|
||||
rating = rating,
|
||||
title = item.Name,
|
||||
year = item.ProductionYear,
|
||||
ids = new TraktShowId
|
||||
{
|
||||
Imdb = item.GetProviderId(MetadataProviders.Imdb),
|
||||
Tvdb = item.GetProviderId(MetadataProviders.Tvdb).ConvertToInt()
|
||||
imdb = item.GetProviderId(MetadataProviders.Imdb),
|
||||
tvdb = item.GetProviderId(MetadataProviders.Tvdb).ConvertToInt()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -787,17 +787,17 @@ namespace Trakt.Api
|
||||
: null;
|
||||
return new TraktMovieWatched
|
||||
{
|
||||
Title = m.Name,
|
||||
Ids = new TraktMovieId
|
||||
title = m.Name,
|
||||
ids = new TraktMovieId
|
||||
{
|
||||
Imdb = m.GetProviderId(MetadataProviders.Imdb),
|
||||
Tmdb =
|
||||
imdb = m.GetProviderId(MetadataProviders.Imdb),
|
||||
tmdb =
|
||||
string.IsNullOrEmpty(m.GetProviderId(MetadataProviders.Tmdb))
|
||||
? (int?)null
|
||||
: ParseId(m.GetProviderId(MetadataProviders.Tmdb))
|
||||
},
|
||||
Year = m.ProductionYear,
|
||||
WatchedAt = lastPlayedDate.HasValue ? lastPlayedDate.Value.ToISO8601() : null
|
||||
year = m.ProductionYear,
|
||||
watched_at = lastPlayedDate.HasValue ? lastPlayedDate.Value.ToISO8601() : null
|
||||
};
|
||||
}).ToList();
|
||||
var chunks = moviesPayload.ToChunks(100).ToList();
|
||||
@ -807,7 +807,7 @@ namespace Trakt.Api
|
||||
{
|
||||
var data = new TraktSyncWatched
|
||||
{
|
||||
Movies = chunk.ToList()
|
||||
movies = chunk.ToList()
|
||||
};
|
||||
var url = seen ? TraktUris.SyncWatchedHistoryAdd : TraktUris.SyncWatchedHistoryRemove;
|
||||
|
||||
@ -856,7 +856,7 @@ namespace Trakt.Api
|
||||
|
||||
private async Task<TraktSyncResponse> SendEpisodePlaystateUpdatesInternalAsync(IEnumerable<Episode> episodeChunk, TraktUser traktUser, bool seen, CancellationToken cancellationToken)
|
||||
{
|
||||
var data = new TraktSyncWatched { Episodes = new List<TraktEpisodeWatched>(), Shows = new List<TraktShowWatched>() };
|
||||
var data = new TraktSyncWatched { episodes = new List<TraktEpisodeWatched>(), shows = new List<TraktShowWatched>() };
|
||||
foreach (var episode in episodeChunk)
|
||||
{
|
||||
var tvDbId = episode.GetProviderId(MetadataProviders.Tvdb);
|
||||
@ -867,13 +867,13 @@ namespace Trakt.Api
|
||||
if (!string.IsNullOrEmpty(tvDbId) && (!episode.IndexNumber.HasValue || !episode.IndexNumberEnd.HasValue || episode.IndexNumberEnd <= episode.IndexNumber))
|
||||
{
|
||||
|
||||
data.Episodes.Add(new TraktEpisodeWatched
|
||||
data.episodes.Add(new TraktEpisodeWatched
|
||||
{
|
||||
Ids = new TraktEpisodeId
|
||||
ids = new TraktEpisodeId
|
||||
{
|
||||
Tvdb = int.Parse(tvDbId)
|
||||
tvdb = int.Parse(tvDbId)
|
||||
},
|
||||
WatchedAt = lastPlayedDate.HasValue ? lastPlayedDate.Value.ToISO8601() : null
|
||||
watched_at = lastPlayedDate.HasValue ? lastPlayedDate.Value.ToISO8601() : null
|
||||
});
|
||||
}
|
||||
else if (episode.IndexNumber != null)
|
||||
@ -881,37 +881,37 @@ namespace Trakt.Api
|
||||
var indexNumber = episode.IndexNumber.Value;
|
||||
var finalNumber = (episode.IndexNumberEnd ?? episode.IndexNumber).Value;
|
||||
|
||||
var syncShow = data.Shows.FirstOrDefault(sre => sre.Ids != null && sre.Ids.Tvdb == episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt());
|
||||
var syncShow = data.shows.FirstOrDefault(sre => sre.ids != null && sre.ids.tvdb == episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt());
|
||||
if (syncShow == null)
|
||||
{
|
||||
syncShow = new TraktShowWatched
|
||||
{
|
||||
Ids = new TraktShowId
|
||||
ids = new TraktShowId
|
||||
{
|
||||
Tvdb = episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt(),
|
||||
Imdb = episode.Series.GetProviderId(MetadataProviders.Imdb),
|
||||
TvRage = episode.Series.GetProviderId(MetadataProviders.TvRage).ConvertToInt()
|
||||
tvdb = episode.Series.GetProviderId(MetadataProviders.Tvdb).ConvertToInt(),
|
||||
imdb = episode.Series.GetProviderId(MetadataProviders.Imdb),
|
||||
tvrage = episode.Series.GetProviderId(MetadataProviders.TvRage).ConvertToInt()
|
||||
},
|
||||
Seasons = new List<TraktSeasonWatched>()
|
||||
seasons = new List<TraktSeasonWatched>()
|
||||
};
|
||||
data.Shows.Add(syncShow);
|
||||
data.shows.Add(syncShow);
|
||||
}
|
||||
var syncSeason = syncShow.Seasons.FirstOrDefault(ss => ss.Number == episode.GetSeasonNumber());
|
||||
var syncSeason = syncShow.seasons.FirstOrDefault(ss => ss.number == episode.GetSeasonNumber());
|
||||
if (syncSeason == null)
|
||||
{
|
||||
syncSeason = new TraktSeasonWatched
|
||||
{
|
||||
Number = episode.GetSeasonNumber(),
|
||||
Episodes = new List<TraktEpisodeWatched>()
|
||||
number = episode.GetSeasonNumber(),
|
||||
episodes = new List<TraktEpisodeWatched>()
|
||||
};
|
||||
syncShow.Seasons.Add(syncSeason);
|
||||
syncShow.seasons.Add(syncSeason);
|
||||
}
|
||||
for (var number = indexNumber; number <= finalNumber; number++)
|
||||
{
|
||||
syncSeason.Episodes.Add(new TraktEpisodeWatched
|
||||
syncSeason.episodes.Add(new TraktEpisodeWatched
|
||||
{
|
||||
Number = number,
|
||||
WatchedAt = lastPlayedDate.HasValue ? lastPlayedDate.Value.ToISO8601() : null
|
||||
number = number,
|
||||
watched_at = lastPlayedDate.HasValue ? lastPlayedDate.Value.ToISO8601() : null
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -928,8 +928,8 @@ namespace Trakt.Api
|
||||
{
|
||||
var data = new TraktUserTokenRequest
|
||||
{
|
||||
Login = traktUser.UserName,
|
||||
Password = traktUser.Password
|
||||
login = traktUser.UserName,
|
||||
password = traktUser.Password
|
||||
};
|
||||
|
||||
using (var response = await PostToTrakt(TraktUris.Login, data, null))
|
||||
@ -1053,7 +1053,7 @@ namespace Trakt.Api
|
||||
|
||||
if (userToken != null)
|
||||
{
|
||||
traktUser.UserToken = userToken.Token;
|
||||
traktUser.UserToken = userToken.token;
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(traktUser.UserToken))
|
||||
|
@ -24,10 +24,10 @@ namespace Trakt
|
||||
|
||||
public static bool IsEmpty(this TraktMetadata metadata)
|
||||
{
|
||||
return string.IsNullOrEmpty(metadata.MediaType) &&
|
||||
string.IsNullOrEmpty(metadata.Resolution) &&
|
||||
string.IsNullOrEmpty(metadata.Audio) &&
|
||||
string.IsNullOrEmpty(metadata.AudioChannels);
|
||||
return string.IsNullOrEmpty(metadata.media_type) &&
|
||||
string.IsNullOrEmpty(metadata.resolution) &&
|
||||
string.IsNullOrEmpty(metadata.audio) &&
|
||||
string.IsNullOrEmpty(metadata.audio_channels);
|
||||
}
|
||||
|
||||
public static string GetCodecRepresetation(this MediaStream audioStream)
|
||||
@ -71,13 +71,13 @@ namespace Trakt
|
||||
var audio = GetCodecRepresetation(audioStream);
|
||||
var audioChannels = audioStream.GetAudioChannels();
|
||||
|
||||
if (collectedMovie.Metadata == null || collectedMovie.Metadata.IsEmpty())
|
||||
if (collectedMovie.metadata == null || collectedMovie.metadata.IsEmpty())
|
||||
{
|
||||
return !string.IsNullOrEmpty(resolution) || !string.IsNullOrEmpty(audio) || !string.IsNullOrEmpty(audioChannels);
|
||||
}
|
||||
return collectedMovie.Metadata.Audio != audio ||
|
||||
collectedMovie.Metadata.AudioChannels != audioChannels ||
|
||||
collectedMovie.Metadata.Resolution != resolution;
|
||||
return collectedMovie.metadata.audio != audio ||
|
||||
collectedMovie.metadata.audio_channels != audioChannels ||
|
||||
collectedMovie.metadata.resolution != resolution;
|
||||
}
|
||||
|
||||
public static string GetResolution(this MediaStream videoStream)
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
@ -20,6 +21,11 @@ namespace Trakt
|
||||
|
||||
public override string Name => "Trakt";
|
||||
|
||||
private Guid _id = new Guid("8abc6789-fde2-4705-8592-4028806fa343");
|
||||
public override Guid Id
|
||||
{
|
||||
get { return _id; }
|
||||
}
|
||||
|
||||
public override string Description
|
||||
=> "Watch, rate and discover media using Trakt. The htpc just got more social";
|
||||
|
@ -1,31 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Trakt")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Trakt")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("8abc6789-fde2-4705-8592-4028806fa343")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
@ -156,7 +156,7 @@ namespace Trakt.ScheduledTasks
|
||||
}
|
||||
|
||||
// keep the highest play count
|
||||
int playcount = Math.Max(matchedMovie.Plays, userData.PlayCount);
|
||||
int playcount = Math.Max(matchedMovie.plays, userData.PlayCount);
|
||||
|
||||
// set movie playcount
|
||||
if (userData.PlayCount != playcount)
|
||||
@ -166,9 +166,9 @@ namespace Trakt.ScheduledTasks
|
||||
}
|
||||
|
||||
// Set last played to whichever is most recent, remote or local time...
|
||||
if (!string.IsNullOrEmpty(matchedMovie.LastWatchedAt))
|
||||
if (!string.IsNullOrEmpty(matchedMovie.last_watched_at))
|
||||
{
|
||||
var tLastPlayed = DateTime.Parse(matchedMovie.LastWatchedAt);
|
||||
var tLastPlayed = DateTime.Parse(matchedMovie.last_watched_at);
|
||||
var latestPlayed = tLastPlayed > userData.LastPlayedDate ? tLastPlayed : userData.LastPlayedDate;
|
||||
if (userData.LastPlayedDate != latestPlayed)
|
||||
{
|
||||
@ -206,9 +206,9 @@ namespace Trakt.ScheduledTasks
|
||||
if (matchedShow != null)
|
||||
{
|
||||
var matchedSeason =
|
||||
matchedShow.Seasons.FirstOrDefault(
|
||||
matchedShow.seasons.FirstOrDefault(
|
||||
tSeason =>
|
||||
tSeason.Number
|
||||
tSeason.number
|
||||
== (episode.ParentIndexNumber == 0
|
||||
? 0
|
||||
: ((episode.ParentIndexNumber ?? 1))));
|
||||
@ -221,7 +221,7 @@ namespace Trakt.ScheduledTasks
|
||||
bool changed = false;
|
||||
|
||||
var matchedEpisode =
|
||||
matchedSeason.Episodes.FirstOrDefault(x => x.Number == (episode.IndexNumber ?? -1));
|
||||
matchedSeason.episodes.FirstOrDefault(x => x.number == (episode.IndexNumber ?? -1));
|
||||
|
||||
if (matchedEpisode != null)
|
||||
{
|
||||
@ -236,7 +236,7 @@ namespace Trakt.ScheduledTasks
|
||||
}
|
||||
|
||||
// keep the highest play count
|
||||
int playcount = Math.Max(matchedEpisode.Plays, userData.PlayCount);
|
||||
int playcount = Math.Max(matchedEpisode.plays, userData.PlayCount);
|
||||
|
||||
// set episode playcount
|
||||
if (userData.PlayCount != playcount)
|
||||
@ -302,22 +302,22 @@ namespace Trakt.ScheduledTasks
|
||||
|
||||
public static TraktShowWatched FindMatch(Series item, IEnumerable<TraktShowWatched> results)
|
||||
{
|
||||
return results.FirstOrDefault(i => IsMatch(item, i.Show));
|
||||
return results.FirstOrDefault(i => IsMatch(item, i.show));
|
||||
}
|
||||
|
||||
public static TraktShowCollected FindMatch(Series item, IEnumerable<TraktShowCollected> results)
|
||||
{
|
||||
return results.FirstOrDefault(i => IsMatch(item, i.Show));
|
||||
return results.FirstOrDefault(i => IsMatch(item, i.show));
|
||||
}
|
||||
|
||||
public static TraktMovieWatched FindMatch(BaseItem item, IEnumerable<TraktMovieWatched> results)
|
||||
{
|
||||
return results.FirstOrDefault(i => IsMatch(item, i.Movie));
|
||||
return results.FirstOrDefault(i => IsMatch(item, i.movie));
|
||||
}
|
||||
|
||||
public static IEnumerable<TraktMovieCollected> FindMatches(BaseItem item, IEnumerable<TraktMovieCollected> results)
|
||||
{
|
||||
return results.Where(i => IsMatch(item, i.Movie)).ToList();
|
||||
return results.Where(i => IsMatch(item, i.movie)).ToList();
|
||||
}
|
||||
|
||||
public static bool IsMatch(BaseItem item, TraktMovie movie)
|
||||
@ -325,19 +325,19 @@ namespace Trakt.ScheduledTasks
|
||||
var imdb = item.GetProviderId(MetadataProviders.Imdb);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(imdb) &&
|
||||
string.Equals(imdb, movie.Ids.Imdb, StringComparison.OrdinalIgnoreCase))
|
||||
string.Equals(imdb, movie.ids.imdb, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var tmdb = item.GetProviderId(MetadataProviders.Tmdb);
|
||||
|
||||
if (movie.Ids.Tmdb.HasValue && string.Equals(tmdb, movie.Ids.Tmdb.Value.ToString(CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase))
|
||||
if (movie.ids.tmdb.HasValue && string.Equals(tmdb, movie.ids.tmdb.Value.ToString(CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (item.Name == movie.Title && item.ProductionYear == movie.Year)
|
||||
if (item.Name == movie.title && item.ProductionYear == movie.year)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -349,14 +349,14 @@ namespace Trakt.ScheduledTasks
|
||||
{
|
||||
var tvdb = item.GetProviderId(MetadataProviders.Tvdb);
|
||||
if (!string.IsNullOrWhiteSpace(tvdb) &&
|
||||
string.Equals(tvdb, show.Ids.Tvdb.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
string.Equals(tvdb, show.ids.tvdb.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var imdb = item.GetProviderId(MetadataProviders.Imdb);
|
||||
if (!string.IsNullOrWhiteSpace(imdb) &&
|
||||
string.Equals(imdb, show.Ids.Imdb, StringComparison.OrdinalIgnoreCase))
|
||||
string.Equals(imdb, show.ids.imdb, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -321,13 +321,13 @@ namespace Trakt.ScheduledTasks
|
||||
var isPlayedTraktTv = false;
|
||||
var traktWatchedShow = SyncFromTraktTask.FindMatch(episode.Series, traktWatchedShows);
|
||||
|
||||
if (traktWatchedShow?.Seasons != null && traktWatchedShow.Seasons.Count > 0)
|
||||
if (traktWatchedShow?.seasons != null && traktWatchedShow.seasons.Count > 0)
|
||||
{
|
||||
isPlayedTraktTv =
|
||||
traktWatchedShow.Seasons.Any(
|
||||
traktWatchedShow.seasons.Any(
|
||||
season =>
|
||||
season.Number == episode.GetSeasonNumber() && season.Episodes != null
|
||||
&& season.Episodes.Any(te => te.Number == episode.IndexNumber && te.Plays > 0));
|
||||
season.number == episode.GetSeasonNumber() && season.episodes != null
|
||||
&& season.episodes.Any(te => te.number == episode.IndexNumber && te.plays > 0));
|
||||
}
|
||||
|
||||
// if the show has been played locally and is unplayed on trakt.tv then add it to the list
|
||||
@ -359,10 +359,10 @@ namespace Trakt.ScheduledTasks
|
||||
}
|
||||
|
||||
var traktCollectedShow = SyncFromTraktTask.FindMatch(episode.Series, traktCollectedShows);
|
||||
if (traktCollectedShow?.Seasons == null
|
||||
|| traktCollectedShow.Seasons.All(x => x.Number != episode.ParentIndexNumber)
|
||||
|| traktCollectedShow.Seasons.First(x => x.Number == episode.ParentIndexNumber)
|
||||
.Episodes.All(e => e.Number != episode.IndexNumber))
|
||||
if (traktCollectedShow?.seasons == null
|
||||
|| traktCollectedShow.seasons.All(x => x.number != episode.ParentIndexNumber)
|
||||
|| traktCollectedShow.seasons.First(x => x.number == episode.ParentIndexNumber)
|
||||
.episodes.All(e => e.number != episode.IndexNumber))
|
||||
{
|
||||
collectedEpisodes.Add(episode);
|
||||
}
|
||||
@ -455,26 +455,26 @@ namespace Trakt.ScheduledTasks
|
||||
|
||||
private void LogTraktResponseDataContract(TraktSyncResponse dataContract)
|
||||
{
|
||||
_logger.Debug("TraktResponse Added Movies: " + dataContract.Added.Movies);
|
||||
_logger.Debug("TraktResponse Added Shows: " + dataContract.Added.Shows);
|
||||
_logger.Debug("TraktResponse Added Seasons: " + dataContract.Added.Seasons);
|
||||
_logger.Debug("TraktResponse Added Episodes: " + dataContract.Added.Episodes);
|
||||
foreach (var traktMovie in dataContract.NotFound.Movies)
|
||||
_logger.Debug("TraktResponse Added Movies: " + dataContract.added.movies);
|
||||
_logger.Debug("TraktResponse Added Shows: " + dataContract.added.shows);
|
||||
_logger.Debug("TraktResponse Added Seasons: " + dataContract.added.seasons);
|
||||
_logger.Debug("TraktResponse Added Episodes: " + dataContract.added.episodes);
|
||||
foreach (var traktMovie in dataContract.not_found.movies)
|
||||
{
|
||||
_logger.Error("TraktResponse not Found:" + _jsonSerializer.SerializeToString(traktMovie));
|
||||
}
|
||||
|
||||
foreach (var traktShow in dataContract.NotFound.Shows)
|
||||
foreach (var traktShow in dataContract.not_found.shows)
|
||||
{
|
||||
_logger.Error("TraktResponse not Found:" + _jsonSerializer.SerializeToString(traktShow));
|
||||
}
|
||||
|
||||
foreach (var traktSeason in dataContract.NotFound.Seasons)
|
||||
foreach (var traktSeason in dataContract.not_found.seasons)
|
||||
{
|
||||
_logger.Error("TraktResponse not Found:" + _jsonSerializer.SerializeToString(traktSeason));
|
||||
}
|
||||
|
||||
foreach (var traktEpisode in dataContract.NotFound.Episodes)
|
||||
foreach (var traktEpisode in dataContract.not_found.episodes)
|
||||
{
|
||||
_logger.Error("TraktResponse not Found:" + _jsonSerializer.SerializeToString(traktEpisode));
|
||||
}
|
||||
|
@ -1,133 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{7FFC306B-2680-49C7-8BE0-6358B2A8A409}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Trakt</RootNamespace>
|
||||
<AssemblyName>Trakt</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworks>netstandard1.3;</TargetFrameworks>
|
||||
<AssemblyVersion>3.1.0.0</AssemblyVersion>
|
||||
<FileVersion>3.1.0.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\SharedVersion.cs">
|
||||
<Link>Properties\SharedVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktUserSummary.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktEpisode.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktEpisodeId.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktMovieId.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktShow.cs" />
|
||||
<Compile Include="Api\DataContracts\Comments\TraktComment.cs" />
|
||||
<Compile Include="Api\DataContracts\Scrobble\TraktScrobbleResponse.cs" />
|
||||
<Compile Include="Api\DataContracts\Scrobble\TraktScrobbleEpisode.cs" />
|
||||
<Compile Include="Api\DataContracts\Scrobble\TraktScrobbleMovie.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\Collection\TraktEpisodeCollected.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\Collection\TraktMovieCollected.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\Collection\TraktShowCollected.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\Ratings\TraktEpisodeRated.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\Ratings\TraktMovieRated.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\Ratings\TraktShowRated.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\TraktSync.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\Watched\TraktSeasonWatched.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\Watched\TraktEpisodeWatched.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\Watched\TraktMovieWatched.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\Watched\TraktShowWatched.cs" />
|
||||
<Compile Include="Api\DataContracts\TraktUserTokenRequest.cs" />
|
||||
<Compile Include="Api\DataContracts\Users\Collection\TraktShowCollected.cs" />
|
||||
<Compile Include="Api\DataContracts\Users\Ratings\TraktEpisodeRated.cs" />
|
||||
<Compile Include="Api\DataContracts\Users\Collection\TraktMetadata.cs" />
|
||||
<Compile Include="Api\DataContracts\Users\Ratings\TraktMovieRated.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktRated.cs" />
|
||||
<Compile Include="Api\DataContracts\Users\Ratings\TraktSeasonRated.cs" />
|
||||
<Compile Include="Api\DataContracts\Users\Ratings\TraktShowRated.cs" />
|
||||
<Compile Include="Api\DataContracts\Users\Collection\TraktMovieCollected.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktPerson.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktPersonId.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktSeason.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktSeasonId.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktId.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktMovie.cs" />
|
||||
<Compile Include="Api\DataContracts\BaseModel\TraktShowId.cs" />
|
||||
<Compile Include="Api\DataContracts\Sync\TraktSyncResponse.cs" />
|
||||
<Compile Include="Api\DataContracts\TraktUserToken.cs" />
|
||||
<Compile Include="Api\DataContracts\Users\Watched\TraktMovieWatched.cs" />
|
||||
<Compile Include="Api\DataContracts\Users\Watched\TraktShowWatched.cs" />
|
||||
<Compile Include="Api\ServerApiEndpoints.cs" />
|
||||
<Compile Include="Api\TraktApi.cs" />
|
||||
<Compile Include="Api\TraktURIs.cs" />
|
||||
<Compile Include="Configuration\PluginConfiguration.cs" />
|
||||
<Compile Include="Enums.cs" />
|
||||
<Compile Include="Extensions.cs" />
|
||||
<Compile Include="Helpers\ISplittableProgress.cs" />
|
||||
<Compile Include="Helpers\LibraryManagerEventsHelper.cs" />
|
||||
<Compile Include="Helpers\SplittableProgress.cs" />
|
||||
<Compile Include="Helpers\UserDataManagerEventsHelper.cs" />
|
||||
<Compile Include="Helpers\UserHelpers.cs" />
|
||||
<Compile Include="Model\TraktUser.cs" />
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ScheduledTasks\SyncFromTraktTask.cs" />
|
||||
<Compile Include="ScheduledTasks\SyncLibraryTask.cs" />
|
||||
<Compile Include="ServerMediator.cs" />
|
||||
<None Remove="Configuration\configPage.html" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Configuration\configPage.html" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="MediaBrowser.Common, Version=3.2.28.7, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MediaBrowser.Common.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MediaBrowser.Controller, Version=3.2.28.7, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MediaBrowser.Server.Core.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Controller.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MediaBrowser.Model, Version=3.2.28.7, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MediaBrowser.Common.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Model.dll</HintPath>
|
||||
</Reference>
|
||||
<PackageReference Include="mediabrowser.server.core" Version="3.3.0-beta" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\..\Emby.dev\ProgramData-Server\Plugins\" /y</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
||||
</Project>
|
||||
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MediaBrowser.Common" version="3.0.747" targetFramework="portable45-net45+win8" />
|
||||
<package id="MediaBrowser.Server.Core" version="3.0.747" targetFramework="portable45-net45+win8" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user