コード例 #1
0
ファイル: Video.cs プロジェクト: wilhil/MediaBrowser
        protected override async Task <bool> RefreshedOwnedItems(MetadataRefreshOptions options, List <FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
        {
            var hasChanges = await base.RefreshedOwnedItems(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);

            if (IsStacked)
            {
                var tasks = AdditionalParts
                            .Select(i => RefreshMetadataForOwnedVideo(options, i, cancellationToken));

                await Task.WhenAll(tasks).ConfigureAwait(false);
            }

            // Must have a parent to have additional parts or alternate versions
            // In other words, it must be part of the Parent/Child tree
            // The additional parts won't have additional parts themselves
            if (LocationType == LocationType.FileSystem && Parent != null)
            {
                if (!IsStacked)
                {
                    RefreshLinkedAlternateVersions();

                    var tasks = LocalAlternateVersions
                                .Select(i => RefreshMetadataForOwnedVideo(options, i, cancellationToken));

                    await Task.WhenAll(tasks).ConfigureAwait(false);
                }
            }

            return(hasChanges);
        }
コード例 #2
0
        internal override ItemUpdateType UpdateFromResolvedItem(BaseItem newItem)
        {
            var updateType = base.UpdateFromResolvedItem(newItem);

            if (newItem is Video newVideo)
            {
                if (!AdditionalParts.SequenceEqual(newVideo.AdditionalParts, StringComparer.Ordinal))
                {
                    AdditionalParts = newVideo.AdditionalParts;
                    updateType     |= ItemUpdateType.MetadataImport;
                }

                if (!LocalAlternateVersions.SequenceEqual(newVideo.LocalAlternateVersions, StringComparer.Ordinal))
                {
                    LocalAlternateVersions = newVideo.LocalAlternateVersions;
                    updateType            |= ItemUpdateType.MetadataImport;
                }

                if (VideoType != newVideo.VideoType)
                {
                    VideoType   = newVideo.VideoType;
                    updateType |= ItemUpdateType.MetadataImport;
                }
            }

            return(updateType);
        }
コード例 #3
0
ファイル: Video.cs プロジェクト: wilhil/MediaBrowser
 public IEnumerable <Guid> GetAdditionalPartIds()
 {
     return(AdditionalParts.Select(i => LibraryManager.GetNewItemId(i, typeof(Video))));
 }