Skip to content

Commit 020460d

Browse files
committed
Add optional series field for episode events
1 parent f6e3e0e commit 020460d

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

Jellyfin.Webhooks/Formats/DefaultFormat.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using MediaBrowser.Controller.Dto;
1010
using MediaBrowser.Controller.Library;
1111
using MediaBrowser.Model.Dto;
12+
using MediaBrowser.Controller.Entities.TV;
1213

1314
namespace Jellyfin.Webhooks.Formats
1415
{
@@ -27,6 +28,7 @@ public DefaultFormat(HttpClient http, IDtoService dto, IUserManager users)
2728

2829
public async Task Format(Uri url, EventInfo info)
2930
{
31+
var series = info.Item != null && info.Item is Episode ? _dto.GetBaseItemDto((info.Item as Episode).Series, new DtoOptions(true), info.User) : null;
3032
var item = info.Item == null ? null : _dto.GetBaseItemDto(info.Item, new DtoOptions(true), info.User);
3133
var user = info.User == null ? null : _users.GetUserDto(info.User);
3234
var body = new DefaultFormatPayload
@@ -37,6 +39,7 @@ public async Task Format(Uri url, EventInfo info)
3739
User = user,
3840
Server = info.Server,
3941
AdditionalData = info.AdditionalData,
42+
Series = series,
4043
};
4144

4245
var content = new StringContent(JsonSerializer.Serialize(body, JsonDefaults.Options), Encoding.UTF8, "application/json");
@@ -52,5 +55,6 @@ public class DefaultFormatPayload
5255
public SessionInfoDto Session { get; set; }
5356
public ServerInfoDto Server { get; set; }
5457
public object AdditionalData { get; set; }
58+
public BaseItemDto Series { get; set; }
5559
}
5660
}

Jellyfin.Webhooks/Jellyfin.Webhooks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
55
<RootNamespace>Jellyfin.Webhooks</RootNamespace>
6-
<AssemblyVersion>3.3.0.0</AssemblyVersion>
7-
<FileVersion>3.3.0.0</FileVersion>
6+
<AssemblyVersion>3.4.0.0</AssemblyVersion>
7+
<FileVersion>3.4.0.0</FileVersion>
88
</PropertyGroup>
99

1010
<ItemGroup>

build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: "Webhooks"
33
guid: "eb5d7894-8eef-4b36-aa6f-5d124e828ce1"
4-
version: "3.3.0.0"
4+
version: "3.4.0.0"
55
targetAbi: "10.8.0.0"
66
framework: "net6.0"
77
overview: "Webhooks. Flexible and robust"
@@ -12,4 +12,4 @@ owner: "shemanaev"
1212
artifacts:
1313
- "Jellyfin.Webhooks.dll"
1414
changelog: >
15-
Fix NPE when DLNA session starts
15+
Add optional series field for episode events

0 commit comments

Comments
 (0)