public bool HasChanged(IHasMetadata item, IDirectoryService directoryService)
        {
            if (item.EnableRefreshOnDateModifiedChange && !string.IsNullOrWhiteSpace(item.Path) && item.LocationType == LocationType.FileSystem)
            {
                var file = directoryService.GetFile(item.Path);
                if (file != null && file.LastWriteTimeUtc != item.DateModified)
                {
                    return(true);
                }
            }

            if (item.SupportsLocalMetadata)
            {
                var video = item as Video;

                if (video != null && !video.IsPlaceHolder)
                {
                    return(!video.SubtitleFiles
                           .SequenceEqual(SubtitleResolver.GetSubtitleFiles(video, directoryService, _fileSystem, false)
                                          .Select(i => i.FullName)
                                          .OrderBy(i => i), StringComparer.OrdinalIgnoreCase));
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        public bool HasChanged(IHasMetadata item, MetadataStatus status, IDirectoryService directoryService)
        {
            if (status.ItemDateModified.HasValue)
            {
                if (status.ItemDateModified.Value != item.DateModified)
                {
                    return(true);
                }
            }

            if (item.SupportsLocalMetadata)
            {
                var video = item as Video;

                if (video != null && !video.IsPlaceHolder)
                {
                    return(!video.SubtitleFiles
                           .SequenceEqual(SubtitleResolver.GetSubtitleFiles(video, directoryService, _fileSystem, false)
                                          .Select(i => i.FullName)
                                          .OrderBy(i => i), StringComparer.OrdinalIgnoreCase));
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
        public bool HasChanged(IHasMetadata item, IDirectoryService directoryService, DateTime date)
        {
            if (item.DateModified > date)
            {
                return(true);
            }

            if (item is Audio)
            {
                // Moved to plural AlbumArtists
                if (date < new DateTime(2014, 8, 28))
                {
                    return(true);
                }
            }

            if (item.SupportsLocalMetadata)
            {
                var video = item as Video;

                if (video != null && !video.IsPlaceHolder)
                {
                    return(!video.SubtitleFiles
                           .SequenceEqual(SubtitleResolver.GetSubtitleFiles(video, directoryService, _fileSystem, false)
                                          .Select(i => i.FullName)
                                          .OrderBy(i => i), StringComparer.OrdinalIgnoreCase));
                }
            }

            return(false);
        }