mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-03 23:36:38 +01:00
Ensure parts use base type
This commit is contained in:
@@ -537,6 +537,17 @@ namespace MediaBrowser.Controller.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure parts use the expected base type (e.g. Video, not Movie)
|
||||
if (video.GetType() != itemType && Activator.CreateInstance(itemType) is Video correctVideo)
|
||||
{
|
||||
correctVideo.Path = video.Path;
|
||||
correctVideo.Name = video.Name;
|
||||
correctVideo.VideoType = video.VideoType;
|
||||
correctVideo.ProductionYear = video.ProductionYear;
|
||||
correctVideo.ExtraType = video.ExtraType;
|
||||
video = correctVideo;
|
||||
}
|
||||
|
||||
video.Id = id;
|
||||
video.OwnerId = Id;
|
||||
LibraryManager.CreateItem(video, parentFolder);
|
||||
|
||||
Reference in New Issue
Block a user