From be36f1ef4cd133b727f2d455537f23d8a096a7ad Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 28 Feb 2014 23:12:39 -0500 Subject: Added ServerName --- MediaBrowser.ServerApplication/ApplicationHost.cs | 39 ++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.ServerApplication') diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 73f99cda1..1907344a1 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -336,6 +336,42 @@ namespace MediaBrowser.ServerApplication { // Not there, no big deal } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "fanart-movies"), true); + } + catch (IOException) + { + // Not there, no big deal + } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "fanart-music"), true); + } + catch (IOException) + { + // Not there, no big deal + } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "fanart-tv"), true); + } + catch (IOException) + { + // Not there, no big deal + } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tmdb-people"), true); + } + catch (IOException) + { + // Not there, no big deal + } }); } @@ -812,7 +848,8 @@ namespace MediaBrowser.ServerApplication HasUpdateAvailable = _hasUpdateAvailable, SupportsAutoRunAtStartup = SupportsAutoRunAtStartup, TranscodingTempPath = ApplicationPaths.TranscodingTempPath, - IsRunningAsService = IsRunningAsService + IsRunningAsService = IsRunningAsService, + ServerName = string.IsNullOrWhiteSpace(ServerConfigurationManager.Configuration.ServerName) ? Environment.MachineName : ServerConfigurationManager.Configuration.ServerName }; } -- cgit v1.2.3 From 2db452f68f64fe4182e8ef3e83cc236c61fa8d82 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 2 Mar 2014 21:17:12 -0500 Subject: add more data to media report --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 2 +- MediaBrowser.Controller/Entities/BaseItem.cs | 14 +++++++++++++- MediaBrowser.Controller/Entities/IHasMetadata.cs | 6 ------ MediaBrowser.Providers/Manager/MetadataService.cs | 15 --------------- MediaBrowser.ServerApplication/LibraryViewer.cs | 13 ++++++++----- 5 files changed, 22 insertions(+), 28 deletions(-) (limited to 'MediaBrowser.ServerApplication') diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 39cccf28a..9075bdfc6 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -332,7 +332,7 @@ namespace MediaBrowser.Api.UserLibrary var userId = user == null ? (Guid?)null : user.Id; var item = string.IsNullOrEmpty(request.ParentId) ? - user == null ? (BaseItem)_libraryManager.RootFolder : user.RootFolder : + user == null ? _libraryManager.RootFolder : user.RootFolder : _dtoService.GetItemByDtoId(request.ParentId, userId); // Default list type = children diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 923673bd8..f7f2346a8 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -229,7 +229,19 @@ namespace MediaBrowser.Controller.Entities } } - public bool IsUnidentified { get; set; } + [IgnoreDataMember] + public bool IsUnidentified + { + get + { + if (ProviderIds.Any()) + { + return false; + } + + return false; + } + } /// /// Gets or sets the locked fields. diff --git a/MediaBrowser.Controller/Entities/IHasMetadata.cs b/MediaBrowser.Controller/Entities/IHasMetadata.cs index 91f37135f..095db0815 100644 --- a/MediaBrowser.Controller/Entities/IHasMetadata.cs +++ b/MediaBrowser.Controller/Entities/IHasMetadata.cs @@ -49,11 +49,5 @@ namespace MediaBrowser.Controller.Entities /// /// true if XXXX, false otherwise. bool BeforeMetadataRefresh(); - - /// - /// Gets or sets a value indicating whether this instance is unidentified. - /// - /// true if this instance is unidentified; otherwise, false. - bool IsUnidentified { get; set; } } } diff --git a/MediaBrowser.Providers/Manager/MetadataService.cs b/MediaBrowser.Providers/Manager/MetadataService.cs index 9b42820e8..24f4b3b2f 100644 --- a/MediaBrowser.Providers/Manager/MetadataService.cs +++ b/MediaBrowser.Providers/Manager/MetadataService.cs @@ -312,7 +312,6 @@ namespace MediaBrowser.Providers.Manager // Only one local provider allowed per item hasLocalMetadata = true; - item.IsUnidentified = false; break; } @@ -387,9 +386,6 @@ namespace MediaBrowser.Providers.Manager { TIdType id = null; - var unidentifiedCount = 0; - var identifiedCount = 0; - foreach (var provider in providers) { var providerName = provider.GetType().Name; @@ -414,11 +410,9 @@ namespace MediaBrowser.Providers.Manager refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataDownload; - identifiedCount++; } else { - unidentifiedCount++; Logger.Debug("{0} returned no metadata for {1}", providerName, item.Path ?? item.Name); } } @@ -428,20 +422,11 @@ namespace MediaBrowser.Providers.Manager } catch (Exception ex) { - unidentifiedCount++; refreshResult.Status = ProviderRefreshStatus.CompletedWithErrors; refreshResult.ErrorMessage = ex.Message; Logger.ErrorException("Error in {0}", ex, provider.Name); } } - - var isUnidentified = unidentifiedCount > 0 && identifiedCount == 0; - - if (item.IsUnidentified != isUnidentified) - { - item.IsUnidentified = isUnidentified; - refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataImport; - } } private void MergeNewData(TItemType source, TIdType lookupInfo) diff --git a/MediaBrowser.ServerApplication/LibraryViewer.cs b/MediaBrowser.ServerApplication/LibraryViewer.cs index 2bf51be4a..a8eda801b 100644 --- a/MediaBrowser.ServerApplication/LibraryViewer.cs +++ b/MediaBrowser.ServerApplication/LibraryViewer.cs @@ -84,7 +84,8 @@ namespace MediaBrowser.ServerApplication { treeView1.Nodes.Clear(); - IEnumerable children = _currentUser.Name == "Physical" ? new[] { _libraryManager.RootFolder } : _libraryManager.RootFolder.GetChildren(_currentUser, true); + var isPhysical = _currentUser.Name == "Physical"; + IEnumerable children = isPhysical ? new[] { _libraryManager.RootFolder } : _libraryManager.RootFolder.GetChildren(_currentUser, true); children = OrderByName(children, _currentUser); foreach (Folder folder in children) @@ -94,9 +95,9 @@ namespace MediaBrowser.ServerApplication var node = new TreeNode { Tag = currentFolder }; - var subChildren = currentFolder.GetChildren(_currentUser, true); + var subChildren = isPhysical ? currentFolder.Children : currentFolder.GetChildren(_currentUser, true); subChildren = OrderByName(subChildren, _currentUser); - AddChildren(node, subChildren, _currentUser); + AddChildren(node, subChildren, _currentUser, isPhysical); node.Text = currentFolder.Name + " (" + node.Nodes.Count + ")"; @@ -110,7 +111,7 @@ namespace MediaBrowser.ServerApplication /// The parent. /// The children. /// The user. - private void AddChildren(TreeNode parent, IEnumerable children, User user) + private void AddChildren(TreeNode parent, IEnumerable children, User user, bool isPhysical) { foreach (var item in children) { @@ -120,7 +121,9 @@ namespace MediaBrowser.ServerApplication { var prefs = _displayPreferencesManager.GetDisplayPreferences(subFolder.DisplayPreferencesId, user.Id, "LibraryExplorer"); - AddChildren(node, OrderBy(subFolder.GetChildren(user, true), user, prefs.SortBy), user); + var subChildren = isPhysical ? subFolder.Children : subFolder.GetChildren(_currentUser, true); + + AddChildren(node, OrderBy(subChildren, user, prefs.SortBy), user, isPhysical); node.Text = item.Name + " (" + node.Nodes.Count + ")"; } else -- cgit v1.2.3 From a72a297c88a50e48c1dc4a6b58c7213be786e1a0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 3 Mar 2014 23:53:48 -0500 Subject: add more report data --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 39 +++++++++++++++++++++- MediaBrowser.Controller/Entities/TV/Episode.cs | 2 +- .../Providers/BaseItemXmlParser.cs | 1 - .../ScheduledTasks/PeopleValidationTask.cs | 4 +-- .../ScheduledTasks/RefreshMediaLibraryTask.cs | 2 +- .../FFMpeg/FFMpegDownloadInfo.cs | 4 +-- MediaBrowser.WebDashboard/Api/DashboardService.cs | 3 +- .../MediaBrowser.WebDashboard.csproj | 4 ++- 8 files changed, 47 insertions(+), 12 deletions(-) (limited to 'MediaBrowser.ServerApplication') diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 4a5b69704..871c9aecb 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -224,8 +224,14 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "IsLocked", Description = "Optional filter by items that are locked.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public bool? IsLocked { get; set; } - [ApiMember(Name = "HasSubtitles", Description = "Optional filter by items that are unidentified by internet metadata providers.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + [ApiMember(Name = "IsUnidentified", Description = "Optional filter by items that are unidentified by internet metadata providers.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public bool? IsUnidentified { get; set; } + + [ApiMember(Name = "IsPlaceHolder", Description = "Optional filter by items that are placeholders", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public bool? IsPlaceHolder { get; set; } + + [ApiMember(Name = "HasOfficialRating", Description = "Optional filter by items that have official ratings", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public bool? HasOfficialRating { get; set; } } /// @@ -1135,6 +1141,37 @@ namespace MediaBrowser.Api.UserLibrary items = items.Where(i => IsYearMismatched(i) == filterValue); } + if (request.HasOfficialRating.HasValue) + { + var filterValue = request.HasOfficialRating.Value; + + items = items.Where(i => + { + var hasValue = !string.IsNullOrEmpty(i.OfficialRating); + + return hasValue == filterValue; + }); + } + + if (request.IsPlaceHolder.HasValue) + { + var filterValue = request.IsPlaceHolder.Value; + + items = items.Where(i => + { + var isPlaceHolder = false; + + var hasPlaceHolder = i as ISupportsPlaceHolders; + + if (hasPlaceHolder != null) + { + isPlaceHolder = hasPlaceHolder.IsPlaceHolder; + } + + return isPlaceHolder == filterValue; + }); + } + return items; } diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 4a3c82b46..503d1513c 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -185,7 +185,7 @@ namespace MediaBrowser.Controller.Entities.TV { get { - return LocationType == LocationType.Virtual && PremiereDate.HasValue && PremiereDate.Value < DateTime.UtcNow; + return LocationType == LocationType.Virtual && !IsUnaired; } } diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index 0163dec20..d71c7af32 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -779,7 +779,6 @@ namespace MediaBrowser.Controller.Providers break; case "TMDbCollectionId": - case "CollectionNumber": var tmdbCollection = reader.ReadElementContentAsString(); if (!string.IsNullOrWhiteSpace(tmdbCollection)) { diff --git a/MediaBrowser.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs b/MediaBrowser.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs index 7d0593c5f..bfa4fe944 100644 --- a/MediaBrowser.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs +++ b/MediaBrowser.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs @@ -34,9 +34,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks { return new ITaskTrigger[] { - new DailyTrigger { TimeOfDay = TimeSpan.FromHours(2) }, - - new IntervalTrigger{ Interval = TimeSpan.FromHours(24)} + new DailyTrigger { TimeOfDay = TimeSpan.FromHours(3) }, }; } diff --git a/MediaBrowser.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs b/MediaBrowser.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs index 462dc1e78..97dfb2c5d 100644 --- a/MediaBrowser.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs +++ b/MediaBrowser.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs @@ -40,7 +40,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks new SystemEventTrigger{ SystemEvent = SystemEvent.WakeFromSleep}, - new IntervalTrigger{ Interval = TimeSpan.FromHours(4)} + new IntervalTrigger{ Interval = TimeSpan.FromHours(6)} }; } diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs index c560a5b91..2588c3d5c 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs @@ -121,7 +121,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg { return new[] { - "https://copy.com/IB0W4efS6t9A/ffall-2.1.1.tar.gz?download=1" + "https://www.dropbox.com/s/n188rxbulqem8ry/ffmpeg-osx-20131121.gz?dl=1" }; } @@ -148,7 +148,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg //No Unix version available return new string[] {}; - #endif +#endif } return new string[] {}; } diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 0e6010fd0..c10b17d67 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -456,8 +456,6 @@ namespace MediaBrowser.WebDashboard.Api /// Task{Stream}. private async Task GetAllJavascript() { - var assembly = GetType().Assembly; - var scriptFiles = new[] { "extensions.js", @@ -581,6 +579,7 @@ namespace MediaBrowser.WebDashboard.Api await AppendResource(memoryStream, "thirdparty/autonumeric/autoNumeric.min.js", newLineBytes).ConfigureAwait(false); + var assembly = GetType().Assembly; await AppendResource(assembly, memoryStream, "MediaBrowser.WebDashboard.ApiClient.js", newLineBytes).ConfigureAwait(false); foreach (var file in scriptFiles) diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 55f97e1da..4895d203f 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -84,7 +84,9 @@ - + + PreserveNewest + PreserveNewest -- cgit v1.2.3 From c567b96e6263aace00e6b3773052b2c553cefda0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 4 Mar 2014 21:59:00 -0500 Subject: updated ffmpeg --- .../FFMpeg/FFMpegDownloadInfo.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'MediaBrowser.ServerApplication') diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs index 2588c3d5c..c4f529754 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs @@ -11,6 +11,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg { // Windows builds: http://ffmpeg.zeranoe.com/builds/ // Linux builds: http://ffmpeg.gusari.org/static/ + // OS X builds: http://ffmpegmac.net/ public static string Version = ffmpegOsType("Version"); @@ -31,7 +32,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg switch (arg) { case "Version": - return "20140105"; + return "20140304"; case "FFMpegFilename": return "ffmpeg.exe"; case "FFProbeFilename": @@ -68,7 +69,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg switch (arg) { case "Version": - return "linux_x86_20140118"; + return "20140304"; case "FFMpegFilename": return "ffmpeg"; case "FFProbeFilename": @@ -84,7 +85,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg switch (arg) { case "Version": - return "linux_x86_64_20140118"; + return "20140304"; case "FFMpegFilename": return "ffmpeg"; case "FFProbeFilename": @@ -97,7 +98,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg } // Unsupported Unix platform return ""; - #endif +#endif } return ""; } @@ -111,8 +112,8 @@ namespace MediaBrowser.ServerApplication.FFMpeg case PlatformID.Win32NT: return new[] { - "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20140105-git-70937d9-win32-static.7z", - "https://www.dropbox.com/s/oghurnp5zh292ry/ffmpeg-20140105-git-70937d9-win32-static.7z?dl=1" + "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20140304-git-f34cceb-win32-static.7z", + "https://www.dropbox.com/s/6brdetuzbld93jk/ffmpeg-20140304-git-f34cceb-win32-static.7z?dl=1" }; #if __MonoCS__ @@ -131,8 +132,8 @@ namespace MediaBrowser.ServerApplication.FFMpeg { return new[] { - "http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.2014-01-18.tar.gz", - "https://www.dropbox.com/s/b7nkg71sil812hp/ffmpeg.static.32bit.2014-01-04.tar.gz?dl=1" + "http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.2014-03-04.tar.gz", + "https://www.dropbox.com/s/0l76mcauqqkta31/ffmpeg.static.32bit.2014-03-04.tar.gz?dl=1" }; } @@ -140,7 +141,8 @@ namespace MediaBrowser.ServerApplication.FFMpeg { return new[] { - "http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.2014-01-18.tar.gz" + "http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.2014-03-04.tar.gz", + "https://www.dropbox.com/s/9wlxz440mdejuqe/ffmpeg.static.64bit.2014-03-04.tar.gz?dl=1" }; } -- cgit v1.2.3 From 9396f16aed2f304789324afc83e0c9f385c5f00a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 4 Mar 2014 21:59:59 -0500 Subject: add more reporting data --- .../Resolvers/BaseVideoResolver.cs | 24 +++++- .../Configuration/ServerConfiguration.cs | 1 + .../MediaInfo/FFProbeVideoInfo.cs | 92 ++++++++++++---------- MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs | 3 + MediaBrowser.Providers/TV/TvdbSeriesProvider.cs | 2 +- MediaBrowser.ServerApplication/ApplicationHost.cs | 24 +++++- 6 files changed, 101 insertions(+), 45 deletions(-) (limited to 'MediaBrowser.ServerApplication') diff --git a/MediaBrowser.Controller/Resolvers/BaseVideoResolver.cs b/MediaBrowser.Controller/Resolvers/BaseVideoResolver.cs index 9e5d68c48..06bee2ad1 100644 --- a/MediaBrowser.Controller/Resolvers/BaseVideoResolver.cs +++ b/MediaBrowser.Controller/Resolvers/BaseVideoResolver.cs @@ -35,6 +35,7 @@ namespace MediaBrowser.Controller.Resolvers // If the path is a file check for a matching extensions if (!args.IsDirectory) { + // http://wiki.xbmc.org/index.php?title=Media_stubs var isPlaceHolder = EntityResolutionHelper.IsVideoPlaceHolder(args.Path); if (EntityResolutionHelper.IsVideoFile(args.Path) || isPlaceHolder) @@ -44,13 +45,34 @@ namespace MediaBrowser.Controller.Resolvers var type = string.Equals(extension, ".iso", StringComparison.OrdinalIgnoreCase) || string.Equals(extension, ".img", StringComparison.OrdinalIgnoreCase) ? VideoType.Iso : VideoType.VideoFile; - return new TVideoType + var video = new TVideoType { VideoType = type, Path = args.Path, IsInMixedFolder = true, IsPlaceHolder = isPlaceHolder }; + + if (isPlaceHolder) + { + if (args.Path.EndsWith("dvd.disc", StringComparison.OrdinalIgnoreCase)) + { + video.VideoType = VideoType.Dvd; + } + else if (args.Path.EndsWith("hddvd.disc", StringComparison.OrdinalIgnoreCase)) + { + video.VideoType = VideoType.HdDvd; + } + else if (args.Path.EndsWith("bluray.disc", StringComparison.OrdinalIgnoreCase) || + args.Path.EndsWith("brrip.disc", StringComparison.OrdinalIgnoreCase) || + args.Path.EndsWith("bd25.disc", StringComparison.OrdinalIgnoreCase) || + args.Path.EndsWith("bd50.disc", StringComparison.OrdinalIgnoreCase)) + { + video.VideoType = VideoType.BluRay; + } + } + + return video; } } diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index fc232edb3..0bff8a1bd 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -210,6 +210,7 @@ namespace MediaBrowser.Model.Configuration public PathSubstitution[] PathSubstitutions { get; set; } public string ServerName { get; set; } + public string WanDdns { get; set; } /// /// Initializes a new instance of the class. diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs index 620a7a6f6..c2279fb50 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs @@ -53,9 +53,18 @@ namespace MediaBrowser.Providers.MediaInfo { var isoMount = await MountIsoIfNeeded(item, cancellationToken).ConfigureAwait(false); + BlurayDiscInfo blurayDiscInfo = null; + try { - OnPreFetch(item, isoMount); + if (item.VideoType == VideoType.BluRay || (item.IsoType.HasValue && item.IsoType == IsoType.BluRay)) + { + var inputPath = isoMount != null ? isoMount.MountedPath : item.Path; + + blurayDiscInfo = GetBDInfo(inputPath); + } + + OnPreFetch(item, isoMount, blurayDiscInfo); // If we didn't find any satisfying the min length, just take them all if (item.VideoType == VideoType.Dvd || (item.IsoType.HasValue && item.IsoType == IsoType.Dvd)) @@ -67,6 +76,15 @@ namespace MediaBrowser.Providers.MediaInfo } } + if (item.VideoType == VideoType.BluRay || (item.IsoType.HasValue && item.IsoType == IsoType.BluRay)) + { + if (item.PlayableStreamFileNames.Count == 0) + { + _logger.Error("No playable vobs found in bluray structure, skipping ffprobe."); + return ItemUpdateType.MetadataImport; + } + } + var result = await GetMediaInfo(item, isoMount, cancellationToken).ConfigureAwait(false); cancellationToken.ThrowIfCancellationRequested(); @@ -75,7 +93,7 @@ namespace MediaBrowser.Providers.MediaInfo cancellationToken.ThrowIfCancellationRequested(); - await Fetch(item, cancellationToken, result, isoMount, directoryService).ConfigureAwait(false); + await Fetch(item, cancellationToken, result, isoMount, blurayDiscInfo, directoryService).ConfigureAwait(false); } finally @@ -128,7 +146,7 @@ namespace MediaBrowser.Providers.MediaInfo return result; } - protected async Task Fetch(Video video, CancellationToken cancellationToken, InternalMediaInfoResult data, IIsoMount isoMount, IDirectoryService directoryService) + protected async Task Fetch(Video video, CancellationToken cancellationToken, InternalMediaInfoResult data, IIsoMount isoMount, BlurayDiscInfo blurayInfo, IDirectoryService directoryService) { if (data.format != null) { @@ -147,8 +165,7 @@ namespace MediaBrowser.Providers.MediaInfo if (video.VideoType == VideoType.BluRay || (video.IsoType.HasValue && video.IsoType.Value == IsoType.BluRay)) { - var inputPath = isoMount != null ? isoMount.MountedPath : video.Path; - FetchBdInfo(video, chapters, mediaStreams, inputPath, cancellationToken); + FetchBdInfo(video, chapters, mediaStreams, blurayInfo); } AddExternalSubtitles(video, mediaStreams, directoryService); @@ -183,14 +200,10 @@ namespace MediaBrowser.Providers.MediaInfo await _itemRepo.SaveChapters(video.Id, chapters, cancellationToken).ConfigureAwait(false); } - private void FetchBdInfo(BaseItem item, List chapters, List mediaStreams, string inputPath, CancellationToken cancellationToken) + private void FetchBdInfo(BaseItem item, List chapters, List mediaStreams, BlurayDiscInfo blurayInfo) { var video = (Video)item; - var result = GetBDInfo(inputPath); - - cancellationToken.ThrowIfCancellationRequested(); - int? currentHeight = null; int? currentWidth = null; int? currentBitRate = null; @@ -206,51 +219,43 @@ namespace MediaBrowser.Providers.MediaInfo } // Fill video properties from the BDInfo result - Fetch(video, mediaStreams, result, chapters); - - videoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video); - - // Use the ffprobe values if these are empty - if (videoStream != null) - { - videoStream.BitRate = IsEmpty(videoStream.BitRate) ? currentBitRate : videoStream.BitRate; - videoStream.Width = IsEmpty(videoStream.Width) ? currentWidth : videoStream.Width; - videoStream.Height = IsEmpty(videoStream.Height) ? currentHeight : videoStream.Height; - } - } - - private bool IsEmpty(int? num) - { - return !num.HasValue || num.Value == 0; - } - - /// The chapters. - private void Fetch(Video video, List mediaStreams, BlurayDiscInfo stream, List chapters) - { - // Check all input for null/empty/zero - mediaStreams.Clear(); - mediaStreams.AddRange(stream.MediaStreams); + mediaStreams.AddRange(blurayInfo.MediaStreams); - video.MainFeaturePlaylistName = stream.PlaylistName; + video.MainFeaturePlaylistName = blurayInfo.PlaylistName; - if (stream.RunTimeTicks.HasValue && stream.RunTimeTicks.Value > 0) + if (blurayInfo.RunTimeTicks.HasValue && blurayInfo.RunTimeTicks.Value > 0) { - video.RunTimeTicks = stream.RunTimeTicks; + video.RunTimeTicks = blurayInfo.RunTimeTicks; } - video.PlayableStreamFileNames = stream.Files.ToList(); + video.PlayableStreamFileNames = blurayInfo.Files.ToList(); - if (stream.Chapters != null) + if (blurayInfo.Chapters != null) { chapters.Clear(); - chapters.AddRange(stream.Chapters.Select(c => new ChapterInfo + chapters.AddRange(blurayInfo.Chapters.Select(c => new ChapterInfo { StartPositionTicks = TimeSpan.FromSeconds(c).Ticks })); } + + videoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video); + + // Use the ffprobe values if these are empty + if (videoStream != null) + { + videoStream.BitRate = IsEmpty(videoStream.BitRate) ? currentBitRate : videoStream.BitRate; + videoStream.Width = IsEmpty(videoStream.Width) ? currentWidth : videoStream.Width; + videoStream.Height = IsEmpty(videoStream.Height) ? currentHeight : videoStream.Height; + } + } + + private bool IsEmpty(int? num) + { + return !num.HasValue || num.Value == 0; } /// @@ -498,7 +503,7 @@ namespace MediaBrowser.Providers.MediaInfo /// /// The item. /// The mount. - private void OnPreFetch(Video item, IIsoMount mount) + private void OnPreFetch(Video item, IIsoMount mount, BlurayDiscInfo blurayDiscInfo) { if (item.VideoType == VideoType.Iso) { @@ -509,6 +514,11 @@ namespace MediaBrowser.Providers.MediaInfo { FetchFromDvdLib(item, mount); } + + if (item.VideoType == VideoType.BluRay || (item.IsoType.HasValue && item.IsoType.Value == IsoType.BluRay)) + { + item.PlayableStreamFileNames = blurayDiscInfo.Files.ToList(); + } } private void FetchFromDvdLib(Video item, IIsoMount mount) diff --git a/MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs index 08d21ab39..5f6bdfa04 100644 --- a/MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs @@ -45,6 +45,9 @@ namespace MediaBrowser.Providers.TV if (!string.IsNullOrEmpty(seriesTvdbId)) { + await TvdbSeriesProvider.Current.EnsureSeriesInfo(seriesTvdbId, searchInfo.MetadataLanguage, + cancellationToken).ConfigureAwait(false); + var seriesDataPath = TvdbSeriesProvider.GetSeriesDataPath(_config.ApplicationPaths, seriesTvdbId); try diff --git a/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs index 4bd22107c..4b78c1a96 100644 --- a/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs @@ -1005,7 +1005,7 @@ namespace MediaBrowser.Providers.TV /// System.String. internal static string GetSeriesDataPath(IApplicationPaths appPaths) { - var dataPath = Path.Combine(appPaths.DataPath, "tvdb-v3"); + var dataPath = Path.Combine(appPaths.CachePath, "tvdb"); return dataPath; } diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 1907344a1..479e07ee6 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -372,6 +372,15 @@ namespace MediaBrowser.ServerApplication { // Not there, no big deal } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tvdb-v3"), true); + } + catch (IOException) + { + // Not there, no big deal + } }); } @@ -856,11 +865,22 @@ namespace MediaBrowser.ServerApplication private readonly CultureInfo _usCulture = new CultureInfo("en-US"); private string GetWanAddress() { - var ip = WanAddressEntryPoint.WanAddress; + var ip = ServerConfigurationManager.Configuration.WanDdns; + + if (string.IsNullOrWhiteSpace(ip)) + { + ip = WanAddressEntryPoint.WanAddress; + } if (!string.IsNullOrEmpty(ip)) { - return "http://" + ip + ":" + ServerConfigurationManager.Configuration.HttpServerPortNumber.ToString(_usCulture); + if (!ip.StartsWith("http://", StringComparison.OrdinalIgnoreCase) && + !ip.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) + { + ip = "http://" + ip; + } + + return ip + ":" + ServerConfigurationManager.Configuration.HttpServerPortNumber.ToString(_usCulture); } return null; -- cgit v1.2.3