mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-06 22:32:57 +01:00
Added a weather api
This commit is contained in:
parent
bcd1a1ca7a
commit
a7b0dd1534
@@ -56,6 +56,9 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Entities\User.cs" />
|
||||
<Compile Include="Entities\UserItemData.cs" />
|
||||
<Compile Include="Weather\WeatherForecast.cs" />
|
||||
<Compile Include="Weather\WeatherInfo.cs" />
|
||||
<Compile Include="Weather\WeatherStatus.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="protobuf-net">
|
||||
|
||||
30
MediaBrowser.Model/Weather/WeatherForecast.cs
Normal file
30
MediaBrowser.Model/Weather/WeatherForecast.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
|
||||
namespace MediaBrowser.Model.Weather
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a weather forecase for a specific date
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public class WeatherForecast
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public int HighTemperatureFahrenheit { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public int LowTemperatureFahrenheit { get; set; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
public int HighTemperatureCelsius { get; set; }
|
||||
|
||||
[ProtoMember(5)]
|
||||
public int LowTemperatureCelsius { get; set; }
|
||||
|
||||
[ProtoMember(6)]
|
||||
public WeatherConditions Condition { get; set; }
|
||||
}
|
||||
}
|
||||
14
MediaBrowser.Model/Weather/WeatherInfo.cs
Normal file
14
MediaBrowser.Model/Weather/WeatherInfo.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using ProtoBuf;
|
||||
|
||||
namespace MediaBrowser.Model.Weather
|
||||
{
|
||||
[ProtoContract]
|
||||
public class WeatherInfo
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public WeatherStatus CurrentWeather { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public WeatherForecast[] Forecasts { get; set; }
|
||||
}
|
||||
}
|
||||
38
MediaBrowser.Model/Weather/WeatherStatus.cs
Normal file
38
MediaBrowser.Model/Weather/WeatherStatus.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using ProtoBuf;
|
||||
|
||||
namespace MediaBrowser.Model.Weather
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the current weather status
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public class WeatherStatus
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public int TemperatureFahrenheit { get; set; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public int TemperatureCelsius { get; set; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public int Humidity { get; set; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
public WeatherConditions Condition { get; set; }
|
||||
}
|
||||
|
||||
public enum WeatherConditions
|
||||
{
|
||||
Sunny,
|
||||
PartlyCloudy,
|
||||
Cloudy,
|
||||
Overcast,
|
||||
Mist,
|
||||
Snow,
|
||||
Rain,
|
||||
Sleet,
|
||||
Fog,
|
||||
Blizzard,
|
||||
Thunderstorm
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user