Browse Source

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

Fix playlist DateCreated and DateLastMediaAdded not being set

Original-merge: 078f9584ed3622eed3516488026cbb6e42242bba

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

Backported-by: Bond_009 <bond.009@outlook.com>
theguymadmax 2 days ago
parent
commit
7e25089c08

+ 1 - 0
Emby.Server.Implementations/Playlists/PlaylistManager.cs

@@ -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);
 

+ 4 - 1
MediaBrowser.Providers/Manager/MetadataService.cs

@@ -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)