Skip to content

Commit 8125148

Browse files
committed
TV Maze Provider - Initial check in
1 parent a379dea commit 8125148

27 files changed

+2145
-2
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
using MediaBrowser.Controller.Entities.TV;
2+
using MediaBrowser.Controller.Providers;
3+
using MediaBrowser.Providers.TV.TvMaze;
4+
5+
namespace MediaBrowser.Plugins.TvMazeProvider
6+
{
7+
public class TvMazeExternalId : IExternalId
8+
{
9+
public string Name
10+
{
11+
get { return "TV Maze Series"; }
12+
}
13+
14+
public string Key
15+
{
16+
get { return MetadataProviders.TvMaze.ToString(); }
17+
}
18+
19+
public string UrlFormatString
20+
{
21+
get { return "http://www.tvmaze.com/shows/{0}"; }
22+
}
23+
24+
public bool Supports(Model.Entities.IHasProviderIds item)
25+
{
26+
return item is Series;
27+
}
28+
}
29+
30+
public class TvMazeEpisodeExternalId : IExternalId
31+
{
32+
public string Name
33+
{
34+
get { return "TV Maze Episode"; }
35+
}
36+
37+
public string Key
38+
{
39+
get { return MetadataProviders.TvMaze.ToString(); }
40+
}
41+
42+
public string UrlFormatString
43+
{
44+
get { return "http://www.tvmaze.com/episodes/{0}"; }
45+
}
46+
47+
public bool Supports(Model.Entities.IHasProviderIds item)
48+
{
49+
return item is Episode;
50+
}
51+
}
52+
53+
public class TvMazeSeasonExternalId : IExternalId
54+
{
55+
public string Name
56+
{
57+
get { return "TV Maze Season"; }
58+
}
59+
60+
public string Key
61+
{
62+
get { return MetadataProviders.TvMaze.ToString(); }
63+
}
64+
65+
public string UrlFormatString
66+
{
67+
get { return "http://www.tvmaze.com/seasons/{0}/season"; }
68+
}
69+
70+
public bool Supports(Model.Entities.IHasProviderIds item)
71+
{
72+
return item is Season;
73+
}
74+
}
75+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace MediaBrowser.Providers.TV.TvMaze
8+
{
9+
public enum MetadataProviders
10+
{
11+
TvMaze,
12+
Tvdb,
13+
TvRage,
14+
Imdb
15+
}
16+
}
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{5BAAE6C6-4C7C-4B6F-A475-07AF0FEF8620}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>MediaBrowser.Plugins.TvMazeProvider</RootNamespace>
11+
<AssemblyName>MediaBrowser.Plugins.TvMazeProvider</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
15+
<RestorePackages>true</RestorePackages>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="CommonIO, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
36+
<HintPath>..\packages\CommonIO.1.0.0.9\lib\net45\CommonIO.dll</HintPath>
37+
<Private>True</Private>
38+
</Reference>
39+
<Reference Include="Interfaces.IO">
40+
<HintPath>..\packages\Interfaces.IO.1.0.0.5\lib\portable-net45+sl4+wp71+win8+wpa81\Interfaces.IO.dll</HintPath>
41+
<Private>True</Private>
42+
</Reference>
43+
<Reference Include="MediaBrowser.Common, Version=3.1.6052.21679, Culture=neutral, processorArchitecture=MSIL">
44+
<HintPath>..\packages\MediaBrowser.Common.3.0.654\lib\net45\MediaBrowser.Common.dll</HintPath>
45+
<Private>True</Private>
46+
</Reference>
47+
<Reference Include="MediaBrowser.Controller, Version=3.1.6052.21678, Culture=neutral, processorArchitecture=MSIL">
48+
<HintPath>..\packages\MediaBrowser.Server.Core.3.0.654\lib\net45\MediaBrowser.Controller.dll</HintPath>
49+
<Private>True</Private>
50+
</Reference>
51+
<Reference Include="MediaBrowser.Model, Version=3.1.6052.21679, Culture=neutral, processorArchitecture=MSIL">
52+
<HintPath>..\packages\MediaBrowser.Common.3.0.654\lib\net45\MediaBrowser.Model.dll</HintPath>
53+
<Private>True</Private>
54+
</Reference>
55+
<Reference Include="Patterns.Logging, Version=1.0.5494.41209, Culture=neutral, processorArchitecture=MSIL">
56+
<HintPath>..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
57+
<Private>True</Private>
58+
</Reference>
59+
<Reference Include="System" />
60+
<Reference Include="System.Core" />
61+
<Reference Include="System.Web" />
62+
<Reference Include="System.Xml.Linq" />
63+
<Reference Include="System.Data.DataSetExtensions" />
64+
<Reference Include="Microsoft.CSharp" />
65+
<Reference Include="System.Data" />
66+
<Reference Include="System.Xml" />
67+
</ItemGroup>
68+
<ItemGroup>
69+
<Compile Include="..\SharedVersion.cs">
70+
<Link>Properties\SharedVersion.cs</Link>
71+
</Compile>
72+
<Compile Include="Globals.cs" />
73+
<Compile Include="TvMazePlugin.cs" />
74+
<Compile Include="ExternalId.cs" />
75+
<Compile Include="Properties\AssemblyInfo.cs" />
76+
<Compile Include="TvMaze\Models\MazeCastCredit.cs" />
77+
<Compile Include="TvMaze\Models\MazeCastMember.cs" />
78+
<Compile Include="TvMaze\Models\MazeChannel.cs" />
79+
<Compile Include="TvMaze\Models\MazeCountry.cs" />
80+
<Compile Include="TvMaze\Models\MazeCrewCredit.cs" />
81+
<Compile Include="TvMaze\Models\MazeEpisode.cs" />
82+
<Compile Include="TvMaze\Models\MazeExternals.cs" />
83+
<Compile Include="TvMaze\Models\MazeHuman.cs" />
84+
<Compile Include="TvMaze\Models\MazeImage.cs" />
85+
<Compile Include="TvMaze\Models\MazeLink.cs" />
86+
<Compile Include="TvMaze\Models\MazeLinks.cs" />
87+
<Compile Include="TvMaze\Models\MazeRating.cs" />
88+
<Compile Include="TvMaze\Models\MazeSearchContainer.cs" />
89+
<Compile Include="TvMaze\Models\MazeSeason.cs" />
90+
<Compile Include="TvMaze\Models\MazeSeries.cs" />
91+
<Compile Include="TvMaze\TvMazeAdapter.cs" />
92+
<Compile Include="TvMaze\TvMazeEpisodeProvider.cs" />
93+
<Compile Include="TvMaze\TvMazeSeasonImageProvider.cs" />
94+
<Compile Include="TvMaze\TvMazeSeasonProvider.cs" />
95+
<Compile Include="TvMaze\TvMazeSeriesProvider.cs" />
96+
</ItemGroup>
97+
<ItemGroup>
98+
<None Include="packages.config" />
99+
</ItemGroup>
100+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
101+
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
102+
<PropertyGroup>
103+
<PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\..\MediaBrowser\ProgramData-Server\Plugins\" /y</PostBuildEvent>
104+
</PropertyGroup>
105+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
106+
Other similar extension points exist, see Microsoft.Common.targets.
107+
<Target Name="BeforeBuild">
108+
</Target>
109+
<Target Name="AfterBuild">
110+
</Target>
111+
-->
112+
</Project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("MediaBrowser.Plugins.TvMazeProvider")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("softworkz")]
12+
[assembly: AssemblyProduct("TV Maze Metadata Provider")]
13+
[assembly: AssemblyCopyright("Copyright © Emby 2016")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("6C39CA29-6EC8-4E72-A471-9D23136ADAF3")]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
namespace MediaBrowser.Providers.TV.TvMaze.Models
2+
{
3+
/// <summary>
4+
/// Another show the Actor has been in.
5+
/// </summary>
6+
public class MazeCastCredit
7+
{
8+
/// <summary>
9+
/// Accessible links for relevant Cast information.
10+
/// </summary>
11+
public CastLink _links { get; set; }
12+
/// <summary>
13+
/// Accessible links for relevant Cast information.
14+
/// </summary>
15+
public class CastLink
16+
{
17+
/// <summary>
18+
/// Link to the Character Page that this actor plays in a particular show.
19+
/// </summary>
20+
public MazeLink character { get; set; }
21+
/// <summary>
22+
/// Link to the show that this actor stars in.
23+
/// </summary>
24+
public MazeLink show { get; set; }
25+
}
26+
}
27+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System.Collections.Generic;
2+
using System.Threading.Tasks;
3+
4+
namespace MediaBrowser.Providers.TV.TvMaze.Models
5+
{
6+
/// <summary>
7+
/// Information about a particular Actor.
8+
/// </summary>
9+
public class MazeCastMember
10+
{
11+
/// <summary>
12+
/// Actor's information.
13+
/// </summary>
14+
public MazeHuman person { get; set; }
15+
/// <summary>
16+
/// Actors' Character information.
17+
/// </summary>
18+
public MazeHuman character { get; set; }
19+
/// <summary>
20+
/// Collection of all Shows the Actor has played a part in.
21+
/// </summary>
22+
public IReadOnlyCollection<MazeCastCredit> castCredit { get; set; }
23+
/// <summary>
24+
/// Collection of all shows the Actor has done some behind the scenes work in.
25+
/// </summary>
26+
public IReadOnlyCollection<MazeCrewCredit> crewCredit { get; set; }
27+
}
28+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
namespace MediaBrowser.Providers.TV.TvMaze.Models
2+
{
3+
/// <summary>
4+
/// Information about a particular Network or WebChannel.
5+
/// </summary>
6+
public class MazeChannel
7+
{
8+
/// <summary>
9+
/// Channel ID (Network or WebChannel, check Required for Ambiguity.)
10+
/// </summary>
11+
public int id { get; set; }
12+
/// <summary>
13+
/// Name of the Channel.
14+
/// </summary>
15+
public string name { get; set; }
16+
/// <summary>
17+
/// Country the Network originates from.
18+
/// </summary>
19+
public MazeCountry country { get; set; }
20+
}
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
namespace MediaBrowser.Providers.TV.TvMaze.Models
2+
{
3+
/// <summary>
4+
/// Information about a particular Country and Timezone information.
5+
/// </summary>
6+
public class MazeCountry
7+
{
8+
/// <summary>
9+
/// Full Name of Country.
10+
/// </summary>
11+
public string name { get; set; }
12+
/// <summary>
13+
/// ISO 2 Letter Country Code.
14+
/// </summary>
15+
public string code { get; set; }
16+
/// <summary>
17+
/// Timezone this particular show is on.
18+
/// </summary>
19+
public string timezone { get; set; }
20+
}
21+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
namespace MediaBrowser.Providers.TV.TvMaze.Models
2+
{
3+
/// <summary>
4+
/// Another role the Actor has been in.
5+
/// </summary>
6+
public class MazeCrewCredit
7+
{
8+
/// <summary>
9+
/// Type of Role.
10+
/// </summary>
11+
public string type { get; set; }
12+
/// <summary>
13+
/// Accessible links for relevant Cast information.
14+
/// </summary>
15+
public CrewLinks _links { get; set; }
16+
17+
/// <summary>
18+
/// Accessible links for relevant Cast information.
19+
/// </summary>
20+
public class CrewLinks
21+
{
22+
/// <summary>
23+
/// Link to the show in which this role was performed.
24+
/// </summary>
25+
public MazeLink show { get; set; }
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)