From 7309be04220053e37a72548997ad3bd3de452029 Mon Sep 17 00:00:00 2001 From: rlauu <46294892+rlauu@users.noreply.github.com> Date: Sun, 17 Nov 2024 21:43:29 +0100 Subject: [PATCH] fix id --- IntroSkipper/Manager/MediaSegmentUpdateManager.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/IntroSkipper/Manager/MediaSegmentUpdateManager.cs b/IntroSkipper/Manager/MediaSegmentUpdateManager.cs index 622243b..7da6980 100644 --- a/IntroSkipper/Manager/MediaSegmentUpdateManager.cs +++ b/IntroSkipper/Manager/MediaSegmentUpdateManager.cs @@ -3,10 +3,12 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; using IntroSkipper.Data; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller; using MediaBrowser.Model; using Microsoft.Extensions.Logging; @@ -24,7 +26,9 @@ namespace IntroSkipper.Manager private readonly IMediaSegmentManager _mediaSegmentManager = mediaSegmentManager; private readonly ILogger _logger = logger; private readonly IMediaSegmentProvider _segmentProvider = segmentProvider; - private readonly string _name = Plugin.Instance!.Name; + private readonly string _id = Plugin.Instance!.Name.ToLowerInvariant() + .GetMD5() + .ToString("N", CultureInfo.InvariantCulture); /// /// Updates all media items in a List. @@ -50,7 +54,7 @@ namespace IntroSkipper.Manager continue; } - await Task.WhenAll(newSegments.Select(s => _mediaSegmentManager.CreateSegmentAsync(s, _name))).ConfigureAwait(false); + await Task.WhenAll(newSegments.Select(s => _mediaSegmentManager.CreateSegmentAsync(s, _id))).ConfigureAwait(false); _logger.LogDebug("Updated {SegmentCount} segments for episode {EpisodeId}", newSegments.Count, episode.EpisodeId); }