fix: Bilder und dumme min TImings!

This commit is contained in:
2026-03-01 18:19:37 +01:00
parent 25fb75ae0b
commit 6c485aa0f7
5 changed files with 55 additions and 25 deletions

View File

@@ -8,6 +8,7 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Timer = System.Timers.Timer;
@@ -185,10 +186,11 @@ public class SmartNotifyBackgroundService : IHostedService, IDisposable
Overview = item.Overview
};
// Set image URL
if (!string.IsNullOrEmpty(serverUrl))
// Set local image path for attachment-based sending
var imagePath = item.GetImagePath(ImageType.Primary, 0);
if (!string.IsNullOrEmpty(imagePath))
{
notification.ImageUrl = $"{serverUrl}/Items/{item.Id}/Images/Primary";
notification.ImagePath = imagePath;
}
if (item is Episode episode)
@@ -199,10 +201,15 @@ public class SmartNotifyBackgroundService : IHostedService, IDisposable
notification.EpisodeNumber = episode.IndexNumber;
notification.Year = episode.ProductionYear;
// Use series image if episode doesn't have one
if (!string.IsNullOrEmpty(serverUrl) && episode.SeriesId != Guid.Empty)
// Use series image if episode doesn't have its own
if (episode.SeriesId != Guid.Empty)
{
notification.ImageUrl = $"{serverUrl}/Items/{episode.SeriesId}/Images/Primary";
var series = _libraryManager.GetItemById(episode.SeriesId);
var seriesImage = series?.GetImagePath(ImageType.Primary, 0);
if (!string.IsNullOrEmpty(seriesImage))
{
notification.ImagePath = seriesImage;
}
}
}
else if (item is Movie movie)