diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config deleted file mode 100644 index 67f8ea0..0000000 --- a/.nuget/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.nuget/NuGet.exe b/.nuget/NuGet.exe deleted file mode 100644 index c41a0d0..0000000 Binary files a/.nuget/NuGet.exe and /dev/null differ diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets deleted file mode 100644 index d3befda..0000000 --- a/.nuget/NuGet.targets +++ /dev/null @@ -1,153 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\ - - - false - - - false - - - true - - - false - - - - - - - - - - - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - $([System.IO.Path]::Combine($(SolutionDir), "packages")) - - - - - $(SolutionDir).nuget - packages.config - $(SolutionDir)packages - - - - - $(NuGetToolsPath)\nuget.exe - @(PackageSource) - - "$(NuGetExePath)" - mono --runtime=v4.0.30319 $(NuGetExePath) - - $(TargetDir.Trim('\\')) - - -RequireConsent - - $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)" - $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(ResolveReferencesDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SharedVersion.cs b/SharedVersion.cs deleted file mode 100644 index 261ee6a..0000000 --- a/SharedVersion.cs +++ /dev/null @@ -1,3 +0,0 @@ -using System.Reflection; - -[assembly: AssemblyVersion("3.0.*")] diff --git a/Trakt.Test/Properties/AssemblyInfo.cs b/Trakt.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index e43d032..0000000 --- a/Trakt.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -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")] diff --git a/Trakt.Test/SplittableProgressTests.cs b/Trakt.Test/SplittableProgressTests.cs deleted file mode 100644 index dd5697d..0000000 --- a/Trakt.Test/SplittableProgressTests.cs +++ /dev/null @@ -1,59 +0,0 @@ -namespace Trakt.Test -{ - using System; - - using Trakt.Helpers; - - using Xunit; - - public class SplittableProgressTests - { - [Fact] - public void AsIProgress() - { - IProgress mainProg = new SplittableProgress(d => Assert.Equal(100, d)); - mainProg.Report(100); - } - - [Fact] - public void ExtensionConversion() - { - IProgress mainProg = new Progress(d => Assert.Equal(100, d)); - mainProg.ToSplittableProgress().Report(100); - } - - [Fact] - public void ExtensionSplit() - { - IProgress mainProg = new Progress(d => Assert.Equal(25, d)); - mainProg.Split(4).Report(100); - } - - [Fact] - public void Split() - { - var firstSplit = 3; - var expected = 100d / firstSplit; - - IProgress mainProg = new Progress(d => Assert.Equal(expected, d)); - ISplittableProgress 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 mainProg = new Progress(d => Assert.Equal(expected, d)); - ISplittableProgress mainProgS = new SplittableProgress(mainProg.Report); - var grandchildProgS = mainProgS.Split(firstSplit).Split(secondSplit); - - grandchildProgS.Report(100); - } - } -} \ No newline at end of file diff --git a/Trakt.Test/Trakt.Test.csproj b/Trakt.Test/Trakt.Test.csproj deleted file mode 100644 index 1940640..0000000 --- a/Trakt.Test/Trakt.Test.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - 11.0 - Debug - AnyCPU - {E26917D8-838E-40CF-BE87-2911B3096458} - Library - Properties - Trakt.Test - Trakt.Test - en-US - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile7 - v4.5 - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - ..\packages\MediaBrowser.Common.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Common.dll - - - ..\packages\MediaBrowser.Server.Core.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Controller.dll - - - ..\packages\MediaBrowser.Common.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Model.dll - - - ..\packages\xunit.abstractions.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.abstractions.dll - True - - - ..\packages\xunit.assert.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.assert.dll - True - - - ..\packages\xunit.extensibility.core.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.core.dll - True - - - ..\packages\xunit.extensibility.execution.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.execution.dotnet.dll - True - - - - - - - - {7ffc306b-2680-49c7-8be0-6358b2a8a409} - Trakt - - - - - - - - - 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}. - - - - - - \ No newline at end of file diff --git a/Trakt.Test/packages.config b/Trakt.Test/packages.config deleted file mode 100644 index f070cb5..0000000 --- a/Trakt.Test/packages.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/Trakt.sln b/Trakt.sln index 6a7f710..2ccbb94 100644 --- a/Trakt.sln +++ b/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 diff --git a/Trakt/Api/DataContracts/BaseModel/TraktEpisode.cs b/Trakt/Api/DataContracts/BaseModel/TraktEpisode.cs index 10dcf71..8d4ab7c 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktEpisode.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktEpisode.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktEpisodeId.cs b/Trakt/Api/DataContracts/BaseModel/TraktEpisodeId.cs index 0e47e27..d62160b 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktEpisodeId.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktEpisodeId.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktId.cs b/Trakt/Api/DataContracts/BaseModel/TraktId.cs index 60473b1..a1f77bc 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktId.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktId.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktMovie.cs b/Trakt/Api/DataContracts/BaseModel/TraktMovie.cs index 6a5131c..67e946d 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktMovie.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktMovie.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktMovieId.cs b/Trakt/Api/DataContracts/BaseModel/TraktMovieId.cs index 1d2898a..b8e466b 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktMovieId.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktMovieId.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktPerson.cs b/Trakt/Api/DataContracts/BaseModel/TraktPerson.cs index e80a971..a84c85c 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktPerson.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktPerson.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktPersonId.cs b/Trakt/Api/DataContracts/BaseModel/TraktPersonId.cs index 816e351..b8309c4 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktPersonId.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktPersonId.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktRated.cs b/Trakt/Api/DataContracts/BaseModel/TraktRated.cs index b23af3c..547a7ba 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktRated.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktRated.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktSeason.cs b/Trakt/Api/DataContracts/BaseModel/TraktSeason.cs index 3d5a424..3a2371e 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktSeason.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktSeason.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktSeasonId.cs b/Trakt/Api/DataContracts/BaseModel/TraktSeasonId.cs index 4d1f88f..a1f98a3 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktSeasonId.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktSeasonId.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktShow.cs b/Trakt/Api/DataContracts/BaseModel/TraktShow.cs index 7efdc90..0fce775 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktShow.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktShow.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktShowId.cs b/Trakt/Api/DataContracts/BaseModel/TraktShowId.cs index 6862d6d..515efc4 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktShowId.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktShowId.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/BaseModel/TraktUserSummary.cs b/Trakt/Api/DataContracts/BaseModel/TraktUserSummary.cs index 624af2b..14a0b35 100644 --- a/Trakt/Api/DataContracts/BaseModel/TraktUserSummary.cs +++ b/Trakt/Api/DataContracts/BaseModel/TraktUserSummary.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Comments/TraktComment.cs b/Trakt/Api/DataContracts/Comments/TraktComment.cs index 1dc6b77..f4d2101 100644 --- a/Trakt/Api/DataContracts/Comments/TraktComment.cs +++ b/Trakt/Api/DataContracts/Comments/TraktComment.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Scrobble/TraktScrobbleEpisode.cs b/Trakt/Api/DataContracts/Scrobble/TraktScrobbleEpisode.cs index e47b628..67d9ceb 100644 --- a/Trakt/Api/DataContracts/Scrobble/TraktScrobbleEpisode.cs +++ b/Trakt/Api/DataContracts/Scrobble/TraktScrobbleEpisode.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Scrobble/TraktScrobbleMovie.cs b/Trakt/Api/DataContracts/Scrobble/TraktScrobbleMovie.cs index 4c1db09..e374faa 100644 --- a/Trakt/Api/DataContracts/Scrobble/TraktScrobbleMovie.cs +++ b/Trakt/Api/DataContracts/Scrobble/TraktScrobbleMovie.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Scrobble/TraktScrobbleResponse.cs b/Trakt/Api/DataContracts/Scrobble/TraktScrobbleResponse.cs index 064cdf6..8a2e02b 100644 --- a/Trakt/Api/DataContracts/Scrobble/TraktScrobbleResponse.cs +++ b/Trakt/Api/DataContracts/Scrobble/TraktScrobbleResponse.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Sync/Collection/TraktEpisodeCollected.cs b/Trakt/Api/DataContracts/Sync/Collection/TraktEpisodeCollected.cs index 612b397..6301b13 100644 --- a/Trakt/Api/DataContracts/Sync/Collection/TraktEpisodeCollected.cs +++ b/Trakt/Api/DataContracts/Sync/Collection/TraktEpisodeCollected.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Sync/Collection/TraktMovieCollected.cs b/Trakt/Api/DataContracts/Sync/Collection/TraktMovieCollected.cs index 3f0163c..b4ce621 100644 --- a/Trakt/Api/DataContracts/Sync/Collection/TraktMovieCollected.cs +++ b/Trakt/Api/DataContracts/Sync/Collection/TraktMovieCollected.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Sync/Collection/TraktShowCollected.cs b/Trakt/Api/DataContracts/Sync/Collection/TraktShowCollected.cs index 5190d1c..7d75e7f 100644 --- a/Trakt/Api/DataContracts/Sync/Collection/TraktShowCollected.cs +++ b/Trakt/Api/DataContracts/Sync/Collection/TraktShowCollected.cs @@ -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 Seasons { get; set; } + public List 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 Episodes { get; set; } + public List episodes { get; set; } } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Sync/Ratings/TraktEpisodeRated.cs b/Trakt/Api/DataContracts/Sync/Ratings/TraktEpisodeRated.cs index 4dec393..b3ec287 100644 --- a/Trakt/Api/DataContracts/Sync/Ratings/TraktEpisodeRated.cs +++ b/Trakt/Api/DataContracts/Sync/Ratings/TraktEpisodeRated.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Sync/Ratings/TraktMovieRated.cs b/Trakt/Api/DataContracts/Sync/Ratings/TraktMovieRated.cs index 50346a7..5b94371 100644 --- a/Trakt/Api/DataContracts/Sync/Ratings/TraktMovieRated.cs +++ b/Trakt/Api/DataContracts/Sync/Ratings/TraktMovieRated.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Sync/Ratings/TraktShowRated.cs b/Trakt/Api/DataContracts/Sync/Ratings/TraktShowRated.cs index 96bc3b4..61e1e5b 100644 --- a/Trakt/Api/DataContracts/Sync/Ratings/TraktShowRated.cs +++ b/Trakt/Api/DataContracts/Sync/Ratings/TraktShowRated.cs @@ -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 Seasons { get; set; } + public List 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 Episodes { get; set; } + public List episodes { get; set; } } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Sync/TraktSync.cs b/Trakt/Api/DataContracts/Sync/TraktSync.cs index 2d80f18..da8eda5 100644 --- a/Trakt/Api/DataContracts/Sync/TraktSync.cs +++ b/Trakt/Api/DataContracts/Sync/TraktSync.cs @@ -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 { - [DataMember(Name = "movies", EmitDefaultValue = false)] - public List Movies { get; set; } + public List movies { get; set; } - [DataMember(Name = "shows", EmitDefaultValue = false)] - public List Shows { get; set; } + public List shows { get; set; } - [DataMember(Name = "episodes", EmitDefaultValue = false)] - public List Episodes { get; set; } + public List episodes { get; set; } } - [DataContract] public class TraktSyncRated : TraktSync { } - [DataContract] public class TraktSyncWatched : TraktSync { } - [DataContract] public class TraktSyncCollected : TraktSync { } diff --git a/Trakt/Api/DataContracts/Sync/TraktSyncResponse.cs b/Trakt/Api/DataContracts/Sync/TraktSyncResponse.cs index 6c66a24..8c2bc6c 100644 --- a/Trakt/Api/DataContracts/Sync/TraktSyncResponse.cs +++ b/Trakt/Api/DataContracts/Sync/TraktSyncResponse.cs @@ -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 Movies { get; set; } + public List movies { get; set; } - [DataMember(Name = "shows")] - public List Shows { get; set; } + public List shows { get; set; } - [DataMember(Name = "episodes")] - public List Episodes { get; set; } + public List episodes { get; set; } - [DataMember(Name = "seasons")] - public List Seasons { get; set; } + public List seasons { get; set; } - [DataMember(Name = "people")] - public List People { get; set; } + public List people { get; set; } } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Sync/Watched/TraktEpisodeWatched.cs b/Trakt/Api/DataContracts/Sync/Watched/TraktEpisodeWatched.cs index af4eacc..df1c13f 100644 --- a/Trakt/Api/DataContracts/Sync/Watched/TraktEpisodeWatched.cs +++ b/Trakt/Api/DataContracts/Sync/Watched/TraktEpisodeWatched.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Sync/Watched/TraktMovieWatched.cs b/Trakt/Api/DataContracts/Sync/Watched/TraktMovieWatched.cs index a12d16c..888f113 100644 --- a/Trakt/Api/DataContracts/Sync/Watched/TraktMovieWatched.cs +++ b/Trakt/Api/DataContracts/Sync/Watched/TraktMovieWatched.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Sync/Watched/TraktSeasonWatched.cs b/Trakt/Api/DataContracts/Sync/Watched/TraktSeasonWatched.cs index c40cc82..be1ee04 100644 --- a/Trakt/Api/DataContracts/Sync/Watched/TraktSeasonWatched.cs +++ b/Trakt/Api/DataContracts/Sync/Watched/TraktSeasonWatched.cs @@ -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 Episodes { get; set; } + public List episodes { get; set; } } } diff --git a/Trakt/Api/DataContracts/Sync/Watched/TraktShowWatched.cs b/Trakt/Api/DataContracts/Sync/Watched/TraktShowWatched.cs index 40e40ed..232fd5e 100644 --- a/Trakt/Api/DataContracts/Sync/Watched/TraktShowWatched.cs +++ b/Trakt/Api/DataContracts/Sync/Watched/TraktShowWatched.cs @@ -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 Seasons { get; set; } + public List seasons { get; set; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/TraktUserToken.cs b/Trakt/Api/DataContracts/TraktUserToken.cs index fd8872b..06aef68 100644 --- a/Trakt/Api/DataContracts/TraktUserToken.cs +++ b/Trakt/Api/DataContracts/TraktUserToken.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/TraktUserTokenRequest.cs b/Trakt/Api/DataContracts/TraktUserTokenRequest.cs index 6af6b27..29518aa 100644 --- a/Trakt/Api/DataContracts/TraktUserTokenRequest.cs +++ b/Trakt/Api/DataContracts/TraktUserTokenRequest.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Users/Collection/TraktMetadata.cs b/Trakt/Api/DataContracts/Users/Collection/TraktMetadata.cs index 00f1efd..3860739 100644 --- a/Trakt/Api/DataContracts/Users/Collection/TraktMetadata.cs +++ b/Trakt/Api/DataContracts/Users/Collection/TraktMetadata.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Users/Collection/TraktMovieCollected.cs b/Trakt/Api/DataContracts/Users/Collection/TraktMovieCollected.cs index 5e10bda..20cdb4d 100644 --- a/Trakt/Api/DataContracts/Users/Collection/TraktMovieCollected.cs +++ b/Trakt/Api/DataContracts/Users/Collection/TraktMovieCollected.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Users/Collection/TraktShowCollected.cs b/Trakt/Api/DataContracts/Users/Collection/TraktShowCollected.cs index 52acad4..5806502 100644 --- a/Trakt/Api/DataContracts/Users/Collection/TraktShowCollected.cs +++ b/Trakt/Api/DataContracts/Users/Collection/TraktShowCollected.cs @@ -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 Seasons { get; set; } + public List 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 Episodes { get; set; } + public List 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; } } } } diff --git a/Trakt/Api/DataContracts/Users/Ratings/TraktEpisodeRated.cs b/Trakt/Api/DataContracts/Users/Ratings/TraktEpisodeRated.cs index f9adee9..8d2a896 100644 --- a/Trakt/Api/DataContracts/Users/Ratings/TraktEpisodeRated.cs +++ b/Trakt/Api/DataContracts/Users/Ratings/TraktEpisodeRated.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Users/Ratings/TraktMovieRated.cs b/Trakt/Api/DataContracts/Users/Ratings/TraktMovieRated.cs index 0ea2af9..a5d0408 100644 --- a/Trakt/Api/DataContracts/Users/Ratings/TraktMovieRated.cs +++ b/Trakt/Api/DataContracts/Users/Ratings/TraktMovieRated.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Users/Ratings/TraktSeasonRated.cs b/Trakt/Api/DataContracts/Users/Ratings/TraktSeasonRated.cs index cef24a5..09257b2 100644 --- a/Trakt/Api/DataContracts/Users/Ratings/TraktSeasonRated.cs +++ b/Trakt/Api/DataContracts/Users/Ratings/TraktSeasonRated.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Users/Ratings/TraktShowRated.cs b/Trakt/Api/DataContracts/Users/Ratings/TraktShowRated.cs index 87e6a0e..55d8ab3 100644 --- a/Trakt/Api/DataContracts/Users/Ratings/TraktShowRated.cs +++ b/Trakt/Api/DataContracts/Users/Ratings/TraktShowRated.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Users/Watched/TraktMovieWatched.cs b/Trakt/Api/DataContracts/Users/Watched/TraktMovieWatched.cs index e5a4228..c69c8be 100644 --- a/Trakt/Api/DataContracts/Users/Watched/TraktMovieWatched.cs +++ b/Trakt/Api/DataContracts/Users/Watched/TraktMovieWatched.cs @@ -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; } } } \ No newline at end of file diff --git a/Trakt/Api/DataContracts/Users/Watched/TraktShowWatched.cs b/Trakt/Api/DataContracts/Users/Watched/TraktShowWatched.cs index a05d25d..6bdd7b5 100644 --- a/Trakt/Api/DataContracts/Users/Watched/TraktShowWatched.cs +++ b/Trakt/Api/DataContracts/Users/Watched/TraktShowWatched.cs @@ -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 Seasons { get; set; } + public List 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 Episodes { get; set; } + public List 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; } } } } diff --git a/Trakt/Api/TraktApi.cs b/Trakt/Api/TraktApi.cs index 86f2c96..f73e54f 100644 --- a/Trakt/Api/TraktApi.cs +++ b/Trakt/Api/TraktApi.cs @@ -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() + seasons = new List() }; 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() + number = episode.GetSeasonNumber(), + episodes = new List() }; - 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 + seasons = new List { new TraktShowRated.TraktSeasonRated { - Number = episode.GetSeasonNumber(), - Episodes = new List + number = episode.GetSeasonNumber(), + episodes = new List { 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 SendEpisodePlaystateUpdatesInternalAsync(IEnumerable episodeChunk, TraktUser traktUser, bool seen, CancellationToken cancellationToken) { - var data = new TraktSyncWatched { Episodes = new List(), Shows = new List() }; + var data = new TraktSyncWatched { episodes = new List(), shows = new List() }; 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() + seasons = new List() }; - 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() + number = episode.GetSeasonNumber(), + episodes = new List() }; - 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)) diff --git a/Trakt/Extensions.cs b/Trakt/Extensions.cs index bedf37b..ea8f0fb 100644 --- a/Trakt/Extensions.cs +++ b/Trakt/Extensions.cs @@ -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) diff --git a/Trakt/Plugin.cs b/Trakt/Plugin.cs index a6a938e..d56b99d 100644 --- a/Trakt/Plugin.cs +++ b/Trakt/Plugin.cs @@ -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"; diff --git a/Trakt/Properties/AssemblyInfo.cs b/Trakt/Properties/AssemblyInfo.cs deleted file mode 100644 index 7a3df70..0000000 --- a/Trakt/Properties/AssemblyInfo.cs +++ /dev/null @@ -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 -// \ No newline at end of file diff --git a/Trakt/ScheduledTasks/SyncFromTraktTask.cs b/Trakt/ScheduledTasks/SyncFromTraktTask.cs index 64d3083..11b4ff1 100644 --- a/Trakt/ScheduledTasks/SyncFromTraktTask.cs +++ b/Trakt/ScheduledTasks/SyncFromTraktTask.cs @@ -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 results) { - return results.FirstOrDefault(i => IsMatch(item, i.Show)); + return results.FirstOrDefault(i => IsMatch(item, i.show)); } public static TraktShowCollected FindMatch(Series item, IEnumerable results) { - return results.FirstOrDefault(i => IsMatch(item, i.Show)); + return results.FirstOrDefault(i => IsMatch(item, i.show)); } public static TraktMovieWatched FindMatch(BaseItem item, IEnumerable results) { - return results.FirstOrDefault(i => IsMatch(item, i.Movie)); + return results.FirstOrDefault(i => IsMatch(item, i.movie)); } public static IEnumerable FindMatches(BaseItem item, IEnumerable 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; } diff --git a/Trakt/ScheduledTasks/SyncLibraryTask.cs b/Trakt/ScheduledTasks/SyncLibraryTask.cs index 51bd068..6aa329f 100644 --- a/Trakt/ScheduledTasks/SyncLibraryTask.cs +++ b/Trakt/ScheduledTasks/SyncLibraryTask.cs @@ -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)); } diff --git a/Trakt/Trakt.csproj b/Trakt/Trakt.csproj index 3c9e0e3..59cba97 100644 --- a/Trakt/Trakt.csproj +++ b/Trakt/Trakt.csproj @@ -1,133 +1,21 @@ - - - + + - Debug - AnyCPU - {7FFC306B-2680-49C7-8BE0-6358B2A8A409} - Library - Properties - Trakt - Trakt - 512 - ..\ - true - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile7 - v4.5 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + netstandard1.3; + 3.1.0.0 + 3.1.0.0 + - - Properties\SharedVersion.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - ..\packages\MediaBrowser.Common.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Common.dll - - - ..\packages\MediaBrowser.Server.Core.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Controller.dll - - - ..\packages\MediaBrowser.Common.3.0.747\lib\portable-net45+win8+wpa81\MediaBrowser.Model.dll - + - - - - - - xcopy "$(TargetPath)" "$(SolutionDir)\..\Emby.dev\ProgramData-Server\Plugins\" /y - - - - - 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}. - - - - - \ No newline at end of file + + diff --git a/Trakt/packages.config b/Trakt/packages.config deleted file mode 100644 index 59f91a3..0000000 --- a/Trakt/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file