< Summary - Jellyfin

Information
Class: MediaBrowser.Controller.Entities.Video
Assembly: MediaBrowser.Controller
File(s): /srv/git/jellyfin/MediaBrowser.Controller/Entities/Video.cs
Line coverage
8%
Covered lines: 20
Uncovered lines: 212
Coverable lines: 232
Total lines: 668
Line coverage: 8.6%
Branch coverage
9%
Covered branches: 11
Total branches: 112
Branch coverage: 9.8%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 1/23/2026 - 12:11:06 AM Line coverage: 13% (20/153) Branch coverage: 14.1% (11/78) Total lines: 5664/19/2026 - 12:14:27 AM Line coverage: 11% (20/181) Branch coverage: 12.5% (11/88) Total lines: 5665/4/2026 - 12:15:16 AM Line coverage: 8.6% (20/232) Branch coverage: 9.8% (11/112) Total lines: 668 1/23/2026 - 12:11:06 AM Line coverage: 13% (20/153) Branch coverage: 14.1% (11/78) Total lines: 5664/19/2026 - 12:14:27 AM Line coverage: 11% (20/181) Branch coverage: 12.5% (11/88) Total lines: 5665/4/2026 - 12:15:16 AM Line coverage: 8.6% (20/232) Branch coverage: 9.8% (11/112) Total lines: 668

Coverage delta

Coverage delta 3 -3

Metrics

File(s)

/srv/git/jellyfin/MediaBrowser.Controller/Entities/Video.cs

#LineLine coverage
 1#nullable disable
 2
 3#pragma warning disable CS1591
 4
 5using System;
 6using System.Collections.Generic;
 7using System.Globalization;
 8using System.Linq;
 9using System.Text.Json.Serialization;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using Jellyfin.Data.Enums;
 13using Jellyfin.Extensions;
 14using MediaBrowser.Controller.Library;
 15using MediaBrowser.Controller.LiveTv;
 16using MediaBrowser.Controller.Persistence;
 17using MediaBrowser.Controller.Providers;
 18using MediaBrowser.Model.Dto;
 19using MediaBrowser.Model.Entities;
 20using MediaBrowser.Model.IO;
 21using MediaBrowser.Model.MediaInfo;
 22using Microsoft.Extensions.Logging;
 23
 24namespace MediaBrowser.Controller.Entities
 25{
 26    /// <summary>
 27    /// Class Video.
 28    /// </summary>
 29    public class Video : BaseItem,
 30        IHasAspectRatio,
 31        ISupportsPlaceHolders,
 32        IHasMediaSources
 33    {
 44034        public Video()
 35        {
 44036            AdditionalParts = Array.Empty<string>();
 44037            LocalAlternateVersions = Array.Empty<string>();
 44038            SubtitleFiles = Array.Empty<string>();
 44039            AudioFiles = Array.Empty<string>();
 44040            LinkedAlternateVersions = Array.Empty<LinkedChild>();
 44041        }
 42
 43        [JsonIgnore]
 44        public Guid? PrimaryVersionId { get; set; }
 45
 46        public string[] AdditionalParts { get; set; }
 47
 48        public string[] LocalAlternateVersions { get; set; }
 49
 50        public LinkedChild[] LinkedAlternateVersions { get; set; }
 51
 52        [JsonIgnore]
 053        public override bool SupportsPlayedStatus => true;
 54
 55        [JsonIgnore]
 056        public override bool SupportsPeople => true;
 57
 58        [JsonIgnore]
 059        public override bool SupportsInheritedParentImages => true;
 60
 61        [JsonIgnore]
 62        public override bool SupportsPositionTicksResume
 63        {
 64            get
 65            {
 066                var extraType = ExtraType;
 067                if (extraType.HasValue)
 68                {
 069                    if (extraType.Value == Model.Entities.ExtraType.Sample)
 70                    {
 071                        return false;
 72                    }
 73
 074                    if (extraType.Value == Model.Entities.ExtraType.ThemeVideo)
 75                    {
 076                        return false;
 77                    }
 78
 079                    if (extraType.Value == Model.Entities.ExtraType.Trailer)
 80                    {
 081                        return false;
 82                    }
 83                }
 84
 085                return true;
 86            }
 87        }
 88
 89        [JsonIgnore]
 090        public override bool SupportsThemeMedia => true;
 91
 92        /// <summary>
 93        /// Gets or sets the timestamp.
 94        /// </summary>
 95        /// <value>The timestamp.</value>
 96        public TransportStreamTimestamp? Timestamp { get; set; }
 97
 98        /// <summary>
 99        /// Gets or sets the subtitle paths.
 100        /// </summary>
 101        /// <value>The subtitle paths.</value>
 102        public string[] SubtitleFiles { get; set; }
 103
 104        /// <summary>
 105        /// Gets or sets the audio paths.
 106        /// </summary>
 107        /// <value>The audio paths.</value>
 108        public string[] AudioFiles { get; set; }
 109
 110        /// <summary>
 111        /// Gets or sets a value indicating whether this instance has subtitles.
 112        /// </summary>
 113        /// <value><c>true</c> if this instance has subtitles; otherwise, <c>false</c>.</value>
 114        public bool HasSubtitles { get; set; }
 115
 116        public bool IsPlaceHolder { get; set; }
 117
 118        /// <summary>
 119        /// Gets or sets the default index of the video stream.
 120        /// </summary>
 121        /// <value>The default index of the video stream.</value>
 122        public int? DefaultVideoStreamIndex { get; set; }
 123
 124        /// <summary>
 125        /// Gets or sets the type of the video.
 126        /// </summary>
 127        /// <value>The type of the video.</value>
 128        public VideoType VideoType { get; set; }
 129
 130        /// <summary>
 131        /// Gets or sets the type of the iso.
 132        /// </summary>
 133        /// <value>The type of the iso.</value>
 134        public IsoType? IsoType { get; set; }
 135
 136        /// <summary>
 137        /// Gets or sets the video3 D format.
 138        /// </summary>
 139        /// <value>The video3 D format.</value>
 140        public Video3DFormat? Video3DFormat { get; set; }
 141
 142        /// <summary>
 143        /// Gets or sets the aspect ratio.
 144        /// </summary>
 145        /// <value>The aspect ratio.</value>
 146        public string AspectRatio { get; set; }
 147
 148        [JsonIgnore]
 0149        public override bool SupportsAddingToPlaylist => true;
 150
 151        [JsonIgnore]
 152        public int MediaSourceCount
 153        {
 154            get
 155            {
 0156                return GetMediaSourceCount();
 157            }
 158        }
 159
 160        [JsonIgnore]
 54161        public bool IsStacked => AdditionalParts.Length > 0;
 162
 163        [JsonIgnore]
 4164        public override bool HasLocalAlternateVersions => LibraryManager.GetLocalAlternateVersionIds(this).Any();
 165
 166        public static IRecordingsManager RecordingsManager { get; set; }
 167
 168        [JsonIgnore]
 169        public override SourceType SourceType
 170        {
 171            get
 172            {
 28173                if (IsActiveRecording())
 174                {
 0175                    return SourceType.LiveTV;
 176                }
 177
 28178                return base.SourceType;
 179            }
 180        }
 181
 182        [JsonIgnore]
 183        public bool IsCompleteMedia
 184        {
 185            get
 186            {
 0187                if (SourceType == SourceType.Channel)
 188                {
 0189                    return !Tags.Contains("livestream", StringComparison.OrdinalIgnoreCase);
 190                }
 191
 0192                return !IsActiveRecording();
 193            }
 194        }
 195
 196        [JsonIgnore]
 0197        protected virtual bool EnableDefaultVideoUserDataKeys => true;
 198
 199        [JsonIgnore]
 200        public override string ContainingFolderPath
 201        {
 202            get
 203            {
 54204                if (IsStacked)
 205                {
 0206                    return System.IO.Path.GetDirectoryName(Path);
 207                }
 208
 54209                if (!IsPlaceHolder)
 210                {
 54211                    if (VideoType == VideoType.BluRay || VideoType == VideoType.Dvd)
 212                    {
 1213                        return Path;
 214                    }
 215                }
 216
 53217                return base.ContainingFolderPath;
 218            }
 219        }
 220
 221        [JsonIgnore]
 222        public override string FileNameWithoutExtension
 223        {
 224            get
 225            {
 31226                if (IsFileProtocol)
 227                {
 31228                    if (VideoType == VideoType.BluRay || VideoType == VideoType.Dvd)
 229                    {
 0230                        return System.IO.Path.GetFileName(Path);
 231                    }
 232
 31233                    return System.IO.Path.GetFileNameWithoutExtension(Path);
 234                }
 235
 0236                return null;
 237            }
 238        }
 239
 240        /// <summary>
 241        /// Gets a value indicating whether [is3 D].
 242        /// </summary>
 243        /// <value><c>true</c> if [is3 D]; otherwise, <c>false</c>.</value>
 244        [JsonIgnore]
 0245        public bool Is3D => Video3DFormat.HasValue;
 246
 247        /// <summary>
 248        /// Gets the type of the media.
 249        /// </summary>
 250        /// <value>The type of the media.</value>
 251        [JsonIgnore]
 0252        public override MediaType MediaType => MediaType.Video;
 253
 254        private int GetMediaSourceCount(HashSet<Guid> callstack = null)
 255        {
 0256            callstack ??= new();
 0257            if (PrimaryVersionId.HasValue)
 258            {
 0259                var item = LibraryManager.GetItemById(PrimaryVersionId.Value);
 0260                if (item is Video video)
 261                {
 0262                    if (callstack.Contains(video.Id))
 263                    {
 264                        // Count alternate versions using LibraryManager
 0265                        var linkedCount = LibraryManager.GetLinkedAlternateVersions(video).Count();
 0266                        var localCount = LibraryManager.GetLocalAlternateVersionIds(video).Count();
 0267                        return linkedCount + localCount + 1;
 268                    }
 269
 0270                    callstack.Add(video.Id);
 0271                    return video.GetMediaSourceCount(callstack);
 272                }
 273            }
 274
 275            // Count alternate versions using LibraryManager
 0276            var linkedVersionCount = LibraryManager.GetLinkedAlternateVersions(this).Count();
 0277            var localVersionCount = LibraryManager.GetLocalAlternateVersionIds(this).Count();
 0278            return linkedVersionCount + localVersionCount + 1;
 279        }
 280
 281        public override List<string> GetUserDataKeys()
 282        {
 0283            var list = base.GetUserDataKeys();
 284
 0285            if (EnableDefaultVideoUserDataKeys)
 286            {
 0287                if (ExtraType.HasValue)
 288                {
 0289                    var key = this.GetProviderId(MetadataProvider.Tmdb);
 0290                    if (!string.IsNullOrEmpty(key))
 291                    {
 0292                        list.Insert(0, GetUserDataKey(key));
 293                    }
 294
 0295                    key = this.GetProviderId(MetadataProvider.Imdb);
 0296                    if (!string.IsNullOrEmpty(key))
 297                    {
 0298                        list.Insert(0, GetUserDataKey(key));
 299                    }
 300                }
 301                else
 302                {
 0303                    var key = this.GetProviderId(MetadataProvider.Imdb);
 0304                    if (!string.IsNullOrEmpty(key))
 305                    {
 0306                        list.Insert(0, key);
 307                    }
 308
 0309                    key = this.GetProviderId(MetadataProvider.Tmdb);
 0310                    if (!string.IsNullOrEmpty(key))
 311                    {
 0312                        list.Insert(0, key);
 313                    }
 314                }
 315            }
 316
 0317            return list;
 318        }
 319
 320        public void SetPrimaryVersionId(Guid? id)
 321        {
 0322            PrimaryVersionId = id;
 0323            PresentationUniqueKey = CreatePresentationUniqueKey();
 0324        }
 325
 326        public override string CreatePresentationUniqueKey()
 327        {
 0328            if (PrimaryVersionId.HasValue)
 329            {
 0330                return PrimaryVersionId.Value.ToString("N", CultureInfo.InvariantCulture);
 331            }
 332
 0333            return base.CreatePresentationUniqueKey();
 334        }
 335
 336        public override bool CanDownload()
 337        {
 0338            if (VideoType == VideoType.Dvd || VideoType == VideoType.BluRay)
 339            {
 0340                return false;
 341            }
 342
 0343            return IsFileProtocol;
 344        }
 345
 346        protected override bool IsActiveRecording()
 347        {
 28348            return RecordingsManager.GetActiveRecordingInfo(Path) is not null;
 349        }
 350
 351        public override bool CanDelete()
 352        {
 0353            if (IsActiveRecording())
 354            {
 0355                return false;
 356            }
 357
 0358            return base.CanDelete();
 359        }
 360
 361        public IEnumerable<Guid> GetAdditionalPartIds()
 362        {
 0363            return AdditionalParts.Select(i => LibraryManager.GetNewItemId(i, typeof(Video)));
 364        }
 365
 366        private string GetUserDataKey(string providerId)
 367        {
 0368            var key = providerId + "-" + ExtraType.ToString().ToLowerInvariant();
 369
 370            // Make sure different trailers have their own data.
 0371            if (RunTimeTicks.HasValue)
 372            {
 0373                key += "-" + RunTimeTicks.Value.ToString(CultureInfo.InvariantCulture);
 374            }
 375
 0376            return key;
 377        }
 378
 379        /// <summary>
 380        /// Gets the additional parts.
 381        /// </summary>
 382        /// <returns>IEnumerable{Video}.</returns>
 383        public IOrderedEnumerable<Video> GetAdditionalParts()
 384        {
 0385            return GetAdditionalPartIds()
 0386                .Select(i => LibraryManager.GetItemById(i))
 0387                .Where(i => i is not null)
 0388                .OfType<Video>()
 0389                .OrderBy(i => i.SortName);
 390        }
 391
 392        internal override ItemUpdateType UpdateFromResolvedItem(BaseItem newItem)
 393        {
 0394            var updateType = base.UpdateFromResolvedItem(newItem);
 395
 0396            if (newItem is Video newVideo)
 397            {
 0398                if (!AdditionalParts.SequenceEqual(newVideo.AdditionalParts, StringComparer.Ordinal))
 399                {
 0400                    AdditionalParts = newVideo.AdditionalParts;
 0401                    updateType |= ItemUpdateType.MetadataImport;
 402                }
 403
 0404                if (!LocalAlternateVersions.SequenceEqual(newVideo.LocalAlternateVersions, StringComparer.Ordinal))
 405                {
 0406                    LocalAlternateVersions = newVideo.LocalAlternateVersions;
 0407                    updateType |= ItemUpdateType.MetadataImport;
 408                }
 409
 0410                if (VideoType != newVideo.VideoType)
 411                {
 0412                    VideoType = newVideo.VideoType;
 0413                    updateType |= ItemUpdateType.MetadataImport;
 414                }
 415            }
 416
 0417            return updateType;
 418        }
 419
 420        protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, IReadOnlyList<FileSystem
 421        {
 0422            var hasChanges = await base.RefreshedOwnedItems(options, fileSystemChildren, cancellationToken).ConfigureAwa
 423
 424            // Clean up LocalAlternateVersions - remove paths that no longer exist
 0425            if (LocalAlternateVersions.Length > 0)
 426            {
 0427                var validPaths = LocalAlternateVersions.Where(FileSystem.FileExists).ToArray();
 0428                if (validPaths.Length != LocalAlternateVersions.Length)
 429                {
 0430                    LocalAlternateVersions = validPaths;
 0431                    hasChanges = true;
 432                }
 433            }
 434
 0435            if (IsStacked)
 436            {
 0437                var tasks = AdditionalParts
 0438                    .Select(i => RefreshMetadataForOwnedVideo(options, true, i, typeof(Video), cancellationToken));
 439
 0440                await Task.WhenAll(tasks).ConfigureAwait(false);
 441            }
 442
 443            // Must have a parent to have additional parts or alternate versions
 444            // In other words, it must be part of the Parent/Child tree
 445            // The additional parts won't have additional parts themselves
 0446            if (IsFileProtocol && SupportsOwnedItems)
 447            {
 448                // Check if LinkedChildren are in sync before processing
 0449                var existingVersionCount = LibraryManager.GetLocalAlternateVersionIds(this).Count();
 0450                var tasks = LocalAlternateVersions
 0451                    .Select(i => RefreshMetadataForVersions(options, false, i, cancellationToken));
 452
 0453                await Task.WhenAll(tasks).ConfigureAwait(false);
 454
 0455                if (existingVersionCount != LocalAlternateVersions.Length)
 456                {
 0457                    hasChanges = true;
 458                }
 459            }
 460
 0461            return hasChanges;
 0462        }
 463
 464        private async Task RefreshMetadataForVersions(
 465            MetadataRefreshOptions options,
 466            bool copyTitleMetadata,
 467            string path,
 468            CancellationToken cancellationToken)
 469        {
 470            // Ensure the alternate version exists with the correct type (e.g. Movie, not Video)
 471            // before refreshing. This must happen here rather than in RefreshMetadataForOwnedVideo
 472            // because that method is also used for stacked parts which should keep their resolved type.
 0473            var id = LibraryManager.GetNewItemId(path, GetType());
 0474            if (LibraryManager.GetItemById(id) is not Video && FileSystem.FileExists(path))
 475            {
 0476                var parentFolder = GetParent() as Folder;
 0477                var collectionType = LibraryManager.GetContentType(this);
 0478                var altVideo = LibraryManager.ResolveAlternateVersion(path, GetType(), parentFolder, collectionType);
 0479                if (altVideo is not null)
 480                {
 0481                    altVideo.OwnerId = Id;
 0482                    altVideo.SetPrimaryVersionId(Id);
 0483                    LibraryManager.CreateItem(altVideo, GetParent());
 484                }
 485            }
 486
 0487            await RefreshMetadataForOwnedVideo(options, copyTitleMetadata, path, cancellationToken).ConfigureAwait(false
 488
 489            // Create LinkedChild entry for this local alternate version
 490            // This ensures the relationship exists in the database even if the alternate version
 491            // was created after the primary video was first saved
 0492            if (LibraryManager.GetItemById(id) is Video video)
 493            {
 0494                LibraryManager.UpsertLinkedChild(Id, video.Id, LinkedChildType.LocalAlternateVersion);
 495
 496                // Ensure PrimaryVersionId is set for existing alternate versions that may not have it
 0497                if (!video.PrimaryVersionId.HasValue)
 498                {
 0499                    video.SetPrimaryVersionId(Id);
 0500                    await video.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(f
 501                }
 502            }
 0503        }
 504
 505        private new Task RefreshMetadataForOwnedVideo(
 506            MetadataRefreshOptions options,
 507            bool copyTitleMetadata,
 508            string path,
 509            CancellationToken cancellationToken)
 0510            => RefreshMetadataForOwnedVideo(options, copyTitleMetadata, path, GetType(), cancellationToken);
 511
 512        private async Task RefreshMetadataForOwnedVideo(
 513            MetadataRefreshOptions options,
 514            bool copyTitleMetadata,
 515            string path,
 516            Type itemType,
 517            CancellationToken cancellationToken)
 518        {
 0519            var newOptions = new MetadataRefreshOptions(options)
 0520            {
 0521                SearchResult = null
 0522            };
 523
 0524            var id = LibraryManager.GetNewItemId(path, itemType);
 525
 526            // Check if the file still exists
 0527            if (!FileSystem.FileExists(path))
 528            {
 529                // File was removed - clean up any orphaned database entry
 0530                if (LibraryManager.GetItemById(id) is Video orphanedVideo && orphanedVideo.OwnerId.Equals(Id))
 531                {
 0532                    Logger.LogInformation("Owned video file no longer exists, removing orphaned item: {Path}", path);
 0533                    LibraryManager.DeleteItem(orphanedVideo, new DeleteOptions { DeleteFileLocation = false });
 534                }
 535
 0536                return;
 537            }
 538
 0539            if (LibraryManager.GetItemById(id) is not Video video)
 540            {
 0541                var parentFolder = GetParent() as Folder;
 0542                var collectionType = LibraryManager.GetContentType(this);
 0543                video = LibraryManager.ResolvePath(
 0544                    FileSystem.GetFileSystemInfo(path),
 0545                    parentFolder,
 0546                    collectionType: collectionType) as Video;
 547
 0548                if (video is null)
 549                {
 0550                    return;
 551                }
 552
 553                // Ensure parts use the expected base type (e.g. Video, not Movie)
 0554                if (video.GetType() != itemType && Activator.CreateInstance(itemType) is Video correctVideo)
 555                {
 0556                    correctVideo.Path = video.Path;
 0557                    correctVideo.Name = video.Name;
 0558                    correctVideo.VideoType = video.VideoType;
 0559                    correctVideo.ProductionYear = video.ProductionYear;
 0560                    correctVideo.ExtraType = video.ExtraType;
 0561                    video = correctVideo;
 562                }
 563
 0564                video.Id = id;
 0565                video.OwnerId = Id;
 0566                LibraryManager.CreateItem(video, parentFolder);
 0567                newOptions.ForceSave = true;
 568            }
 569
 0570            if (video.OwnerId.IsEmpty())
 571            {
 0572                video.OwnerId = Id;
 573            }
 574
 0575            await RefreshMetadataForOwnedItem(video, copyTitleMetadata, newOptions, cancellationToken).ConfigureAwait(fa
 0576        }
 577
 578        /// <inheritdoc />
 579        public override async Task UpdateToRepositoryAsync(ItemUpdateType updateReason, CancellationToken cancellationTo
 580        {
 0581            await base.UpdateToRepositoryAsync(updateReason, cancellationToken).ConfigureAwait(false);
 582
 0583            var localAlternates = LibraryManager.GetLocalAlternateVersionIds(this)
 0584                .Select(i => LibraryManager.GetItemById(i))
 0585                .Where(i => i is not null);
 586
 0587            foreach (var item in localAlternates)
 588            {
 0589                item.ImageInfos = ImageInfos;
 0590                item.Overview = Overview;
 0591                item.ProductionYear = ProductionYear;
 0592                item.PremiereDate = PremiereDate;
 0593                item.CommunityRating = CommunityRating;
 0594                item.OfficialRating = OfficialRating;
 0595                item.Genres = Genres;
 0596                item.ProviderIds = ProviderIds;
 597
 0598                await item.UpdateToRepositoryAsync(ItemUpdateType.MetadataDownload, cancellationToken).ConfigureAwait(fa
 599            }
 0600        }
 601
 602        public override IEnumerable<FileSystemMetadata> GetDeletePaths()
 603        {
 0604            if (!IsInMixedFolder)
 605            {
 0606                return new[]
 0607                {
 0608                    new FileSystemMetadata
 0609                    {
 0610                        FullName = ContainingFolderPath,
 0611                        IsDirectory = true
 0612                    }
 0613                };
 614            }
 615
 0616            return base.GetDeletePaths();
 617        }
 618
 619        public virtual MediaStream GetDefaultVideoStream()
 620        {
 0621            if (!DefaultVideoStreamIndex.HasValue)
 622            {
 0623                return null;
 624            }
 625
 0626            return MediaSourceManager.GetMediaStreams(new MediaStreamQuery
 0627            {
 0628                ItemId = Id,
 0629                Index = DefaultVideoStreamIndex.Value
 0630            }).FirstOrDefault();
 631        }
 632
 633        protected override IEnumerable<(BaseItem Item, MediaSourceType MediaSourceType)> GetAllItemsForMediaSources()
 634        {
 0635            var list = new List<(BaseItem, MediaSourceType)>
 0636            {
 0637                (this, MediaSourceType.Default)
 0638            };
 639
 0640            list.AddRange(
 0641                LibraryManager.GetLinkedAlternateVersions(this)
 0642                    .Select(i => ((BaseItem)i, MediaSourceType.Grouping)));
 643
 0644            if (PrimaryVersionId.HasValue)
 645            {
 0646                if (LibraryManager.GetItemById(PrimaryVersionId.Value) is Video primary)
 647                {
 0648                    var existingIds = list.Select(i => i.Item1.Id).ToList();
 0649                    list.Add((primary, MediaSourceType.Grouping));
 0650                    list.AddRange(LibraryManager.GetLinkedAlternateVersions(primary).Where(i => !existingIds.Contains(i.
 651                }
 652            }
 653
 0654            var localAlternates = list
 0655                .SelectMany(i =>
 0656                {
 0657                    return i.Item1 is Video video ? LibraryManager.GetLocalAlternateVersionIds(video) : Enumerable.Empty
 0658                })
 0659                .Select(LibraryManager.GetItemById)
 0660                .Where(i => i is not null)
 0661                .ToList();
 662
 0663            list.AddRange(localAlternates.Select(i => (i, MediaSourceType.Default)));
 664
 0665            return list;
 666        }
 667    }
 668}