fix: Bilder und dumme min TImings!
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user