Backport pull request #15508 from jellyfin/release-10.11.z

Fix playlist DateCreated and DateLastMediaAdded not being set

Original-merge: 078f9584ed

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Bond_009 <bond.009@outlook.com>
This commit is contained in:
theguymadmax
2025-11-17 14:09:12 -05:00
committed by Bond_009
parent 8fa36a38e2
commit 7e25089c08
2 changed files with 5 additions and 1 deletions

View File

@@ -244,6 +244,7 @@ namespace Emby.Server.Implementations.Playlists
// Update the playlist in the repository
playlist.LinkedChildren = [.. playlist.LinkedChildren, .. childrenToAdd];
playlist.DateLastMediaAdded = DateTime.UtcNow;
await UpdatePlaylistInternal(playlist).ConfigureAwait(false);

View File

@@ -340,7 +340,10 @@ namespace MediaBrowser.Providers.Manager
item.DateModified = info.LastWriteTimeUtc;
if (ServerConfigurationManager.GetMetadataConfiguration().UseFileCreationTimeForDateAdded)
{
item.DateCreated = info.CreationTimeUtc;
if (info.CreationTimeUtc > DateTime.MinValue)
{
item.DateCreated = info.CreationTimeUtc;
}
}
if (item is Video video)