diff options
| -rw-r--r-- | CONTRIBUTORS.md | 1 | ||||
| -rw-r--r-- | Dockerfile | 2 | ||||
| -rw-r--r-- | Emby.Naming/Video/VideoListResolver.cs | 45 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 74 | ||||
| -rw-r--r-- | SharedVersion.cs | 4 | ||||
| -rw-r--r-- | deployment/debian-package-x64/pkg-src/changelog | 16 | ||||
| -rw-r--r-- | deployment/fedora-package-x64/pkg-src/jellyfin.spec | 16 | ||||
| -rw-r--r-- | deployment/windows/build-jellyfin.ps1 | 4 |
8 files changed, 139 insertions, 23 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 39149910c..758202af6 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -19,6 +19,7 @@ - [LogicalPhallacy](https://github.com/LogicalPhallacy/) - [RazeLighter777](https://github.com/RazeLighter777) - [WillWill56](https://github.com/WillWill56) + - [Liggy](https://github.com/Liggy) - [fruhnow](https://github.com/fruhnow) # Emby Contributors diff --git a/Dockerfile b/Dockerfile index 6c0d2515f..978b0d540 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN dotnet publish \ --output /jellyfin \ Jellyfin.Server -FROM jrottenberg/ffmpeg:4.0-vaapi as ffmpeg +FROM jellyfin/ffmpeg as ffmpeg FROM microsoft/dotnet:${DOTNET_VERSION}-runtime # libfontconfig1 is required for Skia RUN apt-get update \ diff --git a/Emby.Naming/Video/VideoListResolver.cs b/Emby.Naming/Video/VideoListResolver.cs index ef97b8739..afedc30ef 100644 --- a/Emby.Naming/Video/VideoListResolver.cs +++ b/Emby.Naming/Video/VideoListResolver.cs @@ -175,25 +175,52 @@ namespace Emby.Naming.Video return videos; } + var list = new List<VideoInfo>(); + var folderName = Path.GetFileName(Path.GetDirectoryName(videos[0].Files[0].Path)); if (!string.IsNullOrEmpty(folderName) && folderName.Length > 1) { - var ordered = videos.OrderBy(i => i.Name); - - return ordered.GroupBy(v => new {v.Name, v.Year}).Select(group => new VideoInfo + if (videos.All(i => i.Files.Count == 1 && IsEligibleForMultiVersion(folderName, i.Files[0].Path))) { - Name = folderName, - Year = group.First().Year, - Files = group.First().Files, - AlternateVersions = group.Skip(1).Select(i => i.Files[0]).ToList(), - Extras = group.First().Extras.Concat(group.Skip(1).SelectMany(i => i.Extras)).ToList() - }); + if (HaveSameYear(videos)) + { + var ordered = videos.OrderBy(i => i.Name).ToList(); + + list.Add(ordered[0]); + + list[0].AlternateVersions = ordered.Skip(1).Select(i => i.Files[0]).ToList(); + list[0].Name = folderName; + list[0].Extras.AddRange(ordered.Skip(1).SelectMany(i => i.Extras)); + + return list; + } + } } return videos; } + private bool HaveSameYear(List<VideoInfo> videos) + { + return videos.Select(i => i.Year ?? -1).Distinct().Count() < 2; + } + + private bool IsEligibleForMultiVersion(string folderName, string testFilename) + { + testFilename = Path.GetFileNameWithoutExtension(testFilename) ?? string.Empty; + + if (testFilename.StartsWith(folderName, StringComparison.OrdinalIgnoreCase)) + { + testFilename = testFilename.Substring(folderName.Length).Trim(); + return string.IsNullOrEmpty(testFilename) || + testFilename.StartsWith("-") || + string.IsNullOrWhiteSpace(Regex.Replace(testFilename, @"\[([^]]*)\]", string.Empty)) ; + } + + return false; + } + private List<VideoFileInfo> GetExtras(IEnumerable<VideoFileInfo> remainingFiles, List<string> baseNames) { foreach (var name in baseNames.ToList()) diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 72c4e3573..43fee79a1 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1283,6 +1283,35 @@ namespace MediaBrowser.Controller.Entities }).OrderBy(i => i.Path).ToArray(); } + protected virtual BaseItem[] LoadExtras(List<FileSystemMetadata> fileSystemChildren, IDirectoryService directoryService) + { + var files = fileSystemChildren.Where(i => i.IsDirectory) + .SelectMany(i => FileSystem.GetFiles(i.FullName)); + + return LibraryManager.ResolvePaths(files, directoryService, null, new LibraryOptions()) + .OfType<Video>() + .Select(item => + { + // Try to retrieve it from the db. If we don't find it, use the resolved version + var dbItem = LibraryManager.GetItemById(item.Id) as Video; + + if (dbItem != null) + { + item = dbItem; + } + else + { + // item is new + item.ExtraType = MediaBrowser.Model.Entities.ExtraType.Clip; + } + + return item; + + // Sort them so that the list can be easily compared for changes + }).OrderBy(i => i.Path).ToArray(); + } + + public Task RefreshMetadata(CancellationToken cancellationToken) { return RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(Logger, FileSystem)), cancellationToken); @@ -1371,6 +1400,8 @@ namespace MediaBrowser.Controller.Entities var themeVideosChanged = false; + var extrasChanged = false; + var localTrailersChanged = false; if (IsFileProtocol && SupportsOwnedItems) @@ -1382,6 +1413,8 @@ namespace MediaBrowser.Controller.Entities themeSongsChanged = await RefreshThemeSongs(this, options, fileSystemChildren, cancellationToken).ConfigureAwait(false); themeVideosChanged = await RefreshThemeVideos(this, options, fileSystemChildren, cancellationToken).ConfigureAwait(false); + + extrasChanged = await RefreshExtras(this, options, fileSystemChildren, cancellationToken).ConfigureAwait(false); } } @@ -1392,7 +1425,7 @@ namespace MediaBrowser.Controller.Entities } } - return themeSongsChanged || themeVideosChanged || localTrailersChanged; + return themeSongsChanged || themeVideosChanged || extrasChanged || localTrailersChanged; } protected virtual FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService) @@ -1435,6 +1468,31 @@ namespace MediaBrowser.Controller.Entities return itemsChanged; } + private async Task<bool> RefreshExtras(BaseItem item, MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken) + { + var newExtras = LoadExtras(fileSystemChildren, options.DirectoryService).Concat(LoadThemeVideos(fileSystemChildren, options.DirectoryService)).Concat(LoadThemeSongs(fileSystemChildren, options.DirectoryService)); + + var newExtraIds = newExtras.Select(i => i.Id).ToArray(); + + var extrasChanged = !item.ExtraIds.SequenceEqual(newExtraIds); + + if (extrasChanged) + { + var ownerId = item.Id; + + var tasks = newExtras.Select(i => + { + return RefreshMetadataForOwnedItem(i, true, new MetadataRefreshOptions(options), cancellationToken); + }); + + await Task.WhenAll(tasks).ConfigureAwait(false); + + item.ExtraIds = newExtraIds; + } + + return extrasChanged; + } + private async Task<bool> RefreshThemeVideos(BaseItem item, MetadataRefreshOptions options, IEnumerable<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken) { var newThemeVideos = LoadThemeVideos(fileSystemChildren, options.DirectoryService); @@ -2775,17 +2833,17 @@ namespace MediaBrowser.Controller.Entities public IEnumerable<BaseItem> GetExtras() { - return ThemeVideoIds.Select(LibraryManager.GetItemById).Where(i => i.ExtraType.Equals(Model.Entities.ExtraType.ThemeVideo)).OrderBy(i => i.SortName); + return ExtraIds.Select(LibraryManager.GetItemById).Where(i => i != null).OrderBy(i => i.SortName); } - public IEnumerable<BaseItem> GetExtras(ExtraType[] unused) + public IEnumerable<BaseItem> GetExtras(ExtraType[] extraTypes) { - return GetExtras(); + return ExtraIds.Select(LibraryManager.GetItemById).Where(i => i != null && extraTypes.Contains(i.ExtraType.Value)).OrderBy(i => i.SortName); } public IEnumerable<BaseItem> GetDisplayExtras() { - return GetExtras(); + return GetExtras(DisplayExtraTypes); } public virtual bool IsHD => Height >= 720; @@ -2798,8 +2856,10 @@ namespace MediaBrowser.Controller.Entities { return RunTimeTicks ?? 0; } - // what does this do? - public static ExtraType[] DisplayExtraTypes = new[] { Model.Entities.ExtraType.ThemeSong, Model.Entities.ExtraType.ThemeVideo }; + + // Possible types of extra videos + public static ExtraType[] DisplayExtraTypes = new[] { Model.Entities.ExtraType.BehindTheScenes, Model.Entities.ExtraType.Clip, Model.Entities.ExtraType.DeletedScene, Model.Entities.ExtraType.Interview, Model.Entities.ExtraType.Sample, Model.Entities.ExtraType.Scene }; + public virtual bool SupportsExternalTransfer => false; } } diff --git a/SharedVersion.cs b/SharedVersion.cs index 294748b77..41eda393a 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("10.2.0")] -[assembly: AssemblyFileVersion("10.2.0")] +[assembly: AssemblyVersion("10.2.1")] +[assembly: AssemblyFileVersion("10.2.1")] diff --git a/deployment/debian-package-x64/pkg-src/changelog b/deployment/debian-package-x64/pkg-src/changelog index 869dc4a5e..7b7efff27 100644 --- a/deployment/debian-package-x64/pkg-src/changelog +++ b/deployment/debian-package-x64/pkg-src/changelog @@ -1,3 +1,19 @@ +jellyfin (10.2.1-1) unstable; urgency=medium + + * jellyfin: + * PR920 Fix cachedir missing from Docker container + * PR924 Use the movie name instead of folder name + * PR933 Semi-revert to prefer old movie grouping behaviour + * PR948 Revert movie matching (supercedes PR933, PR924, PR739) + * PR960 Use jellyfin/ffmpeg image + * jellyfin-web: + * PR136 Re-add OpenSubtitles configuration page + * PR137 Replace HeaderEmbyServer with HeaderJellyfinServer on plugincatalog + * PR138 Remove left-over JS for Customize Home Screen + * PR141 Exit fullscreen automatically after video playback ends + + -- Jellyfin Packaging Team <packaging@jellyfin.org> Wed, 20 Feb 2019 11:36:16 -0500 + jellyfin (10.2.0-2) unstable; urgency=medium * jellyfin: diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/fedora-package-x64/pkg-src/jellyfin.spec index 75821cb17..146486428 100644 --- a/deployment/fedora-package-x64/pkg-src/jellyfin.spec +++ b/deployment/fedora-package-x64/pkg-src/jellyfin.spec @@ -7,8 +7,8 @@ %endif Name: jellyfin -Version: 10.2.0 -Release: 2%{?dist} +Version: 10.2.1 +Release: 1%{?dist} Summary: The Free Software Media Browser License: GPLv2 URL: https://jellyfin.media @@ -140,6 +140,18 @@ fi %systemd_postun_with_restart jellyfin.service %changelog +* Wed Feb 20 2019 Jellyfin Packaging Team <packaging@jellyfin.org> +- jellyfin: +- PR920 Fix cachedir missing from Docker container +- PR924 Use the movie name instead of folder name +- PR933 Semi-revert to prefer old movie grouping behaviour +- PR948 Revert movie matching (supercedes PR933, PR924, PR739) +- PR960 Use jellyfin/ffmpeg image +- jellyfin-web: +- PR136 Re-add OpenSubtitles configuration page +- PR137 Replace HeaderEmbyServer with HeaderJellyfinServer on plugincatalog +- PR138 Remove left-over JS for Customize Home Screen +- PR141 Exit fullscreen automatically after video playback ends * Fri Feb 15 2019 Jellyfin Packaging Team <packaging@jellyfin.org> - jellyfin: - PR452 Use EF Core for Activity database diff --git a/deployment/windows/build-jellyfin.ps1 b/deployment/windows/build-jellyfin.ps1 index 1121c3398..2c83f264c 100644 --- a/deployment/windows/build-jellyfin.ps1 +++ b/deployment/windows/build-jellyfin.ps1 @@ -102,8 +102,8 @@ if($InstallNSSM.IsPresent -or ($InstallNSSM -eq $true)){ Write-Verbose "Starting NSSM Install" Install-NSSM $InstallLocation $Architecture } -Copy-Item .\deployment\win-generic\install-jellyfin.ps1 $InstallLocation\install-jellyfin.ps1 -Copy-Item .\deployment\win-generic\install.bat $InstallLocation\install.bat +Copy-Item .\deployment\windows\install-jellyfin.ps1 $InstallLocation\install-jellyfin.ps1 +Copy-Item .\deployment\windows\install.bat $InstallLocation\install.bat if($GenerateZip.IsPresent -or ($GenerateZip -eq $true)){ Compress-Archive -Path $InstallLocation -DestinationPath "$InstallLocation/jellyfin.zip" -Force } |
