Skip to content

Commit edde7e2

Browse files
committed
Fix
1 parent cc71ee6 commit edde7e2

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin/
2+
obj/
3+
.vscode/
4+
*.user
5+
*.suo

TrailerTask.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Text.RegularExpressions;
77
using System.Text.Json;
88
using System.Text.Json.Nodes;
9+
using Jellyfin.Data.Enums;
910

1011
namespace TrailerFinPlugin
1112
{
@@ -34,11 +35,11 @@ public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
3435
return new[] { new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerDaily, TimeOfDayTicks = 0 } };
3536
}
3637

37-
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
38+
public async Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken)
3839
{
3940
var movies = _libraryManager.GetItemList(new InternalItemsQuery
4041
{
41-
IncludeItemTypes = new[] { nameof(Movie) },
42+
IncludeItemTypes = new[] { BaseItemKind.Movie },
4243
Recursive = true
4344
});
4445

@@ -51,8 +52,7 @@ public async Task Execute(CancellationToken cancellationToken, IProgress<double>
5152

5253
if (item is Movie movie)
5354
{
54-
var imdbId = movie.GetProviderId("Imdb");
55-
if (!string.IsNullOrEmpty(imdbId))
55+
if (movie.ProviderIds.TryGetValue("Imdb", out var imdbId) && !string.IsNullOrEmpty(imdbId))
5656
{
5757
await ProcessMovie(movie, imdbId);
5858
}

0 commit comments

Comments
 (0)