浏览代码

update missing season creator

Luke Pulverenti 9 年之前
父节点
当前提交
2daf91b3fe

+ 0 - 13
MediaBrowser.Controller/Entities/CollectionFolder.cs

@@ -23,19 +23,6 @@ namespace MediaBrowser.Controller.Entities
             PhysicalLocationsList = new List<string>();
         }
 
-        /// <summary>
-        /// Gets a value indicating whether this instance is virtual folder.
-        /// </summary>
-        /// <value><c>true</c> if this instance is virtual folder; otherwise, <c>false</c>.</value>
-        [IgnoreDataMember]
-        public override bool IsVirtualFolder
-        {
-            get
-            {
-                return true;
-            }
-        }
-
         [IgnoreDataMember]
         protected override bool SupportsShortcutChildren
         {

+ 0 - 13
MediaBrowser.Controller/Entities/Folder.cs

@@ -126,19 +126,6 @@ namespace MediaBrowser.Controller.Entities
         /// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value>
         public bool IsRoot { get; set; }
 
-        /// <summary>
-        /// Gets a value indicating whether this instance is virtual folder.
-        /// </summary>
-        /// <value><c>true</c> if this instance is virtual folder; otherwise, <c>false</c>.</value>
-        [IgnoreDataMember]
-        public virtual bool IsVirtualFolder
-        {
-            get
-            {
-                return false;
-            }
-        }
-
         public virtual List<LinkedChild> LinkedChildren { get; set; }
 
         [IgnoreDataMember]

+ 5 - 7
MediaBrowser.Providers/TV/DummySeasonProvider.cs

@@ -69,7 +69,7 @@ namespace MediaBrowser.Providers.TV
 
                 if (!hasSeason)
                 {
-                    await AddSeason(series, seasonNumber, cancellationToken).ConfigureAwait(false);
+                    await AddSeason(series, seasonNumber, false, cancellationToken).ConfigureAwait(false);
 
                     hasChanges = true;
                 }
@@ -83,7 +83,7 @@ namespace MediaBrowser.Providers.TV
 
                 if (!hasSeason)
                 {
-                    await AddSeason(series, null, cancellationToken).ConfigureAwait(false);
+                    await AddSeason(series, null, false, cancellationToken).ConfigureAwait(false);
 
                     hasChanges = true;
                 }
@@ -95,12 +95,9 @@ namespace MediaBrowser.Providers.TV
         /// <summary>
         /// Adds the season.
         /// </summary>
-        /// <param name="series">The series.</param>
-        /// <param name="seasonNumber">The season number.</param>
-        /// <param name="cancellationToken">The cancellation token.</param>
-        /// <returns>Task{Season}.</returns>
         public async Task<Season> AddSeason(Series series,
             int? seasonNumber,
+            bool isMissingSeason,
             CancellationToken cancellationToken)
         {
             var seasonName = seasonNumber == 0 ?
@@ -113,7 +110,8 @@ namespace MediaBrowser.Providers.TV
             {
                 Name = seasonName,
                 IndexNumber = seasonNumber,
-                Id = _libraryManager.GetNewItemId((series.Id + (seasonNumber ?? -1).ToString(_usCulture) + seasonName), typeof(Season))
+                Id = _libraryManager.GetNewItemId((series.Id + (seasonNumber ?? -1).ToString(_usCulture) + seasonName), typeof(Season)),
+                IsMissingSeason = isMissingSeason
             };
 
             season.SetParent(series);

+ 1 - 1
MediaBrowser.Providers/TV/MissingEpisodeProvider.cs

@@ -418,7 +418,7 @@ namespace MediaBrowser.Providers.TV
             if (season == null)
             {
                 var provider = new DummySeasonProvider(_config, _logger, _localization, _libraryManager, _fileSystem);
-                season = await provider.AddSeason(series, seasonNumber, cancellationToken).ConfigureAwait(false);
+                season = await provider.AddSeason(series, seasonNumber, true, cancellationToken).ConfigureAwait(false);
             }
 
             var name = string.Format("Episode {0}", episodeNumber.ToString(_usCulture));

+ 1 - 1
MediaBrowser.Providers/TV/SeasonMetadataService.cs

@@ -69,7 +69,7 @@ namespace MediaBrowser.Providers.TV
 
         private ItemUpdateType SaveIsMissing(Season item, List<Episode> episodes)
         {
-            var isMissing = item.LocationType == LocationType.Virtual && episodes.All(i => i.IsMissingEpisode);
+            var isMissing = item.LocationType == LocationType.Virtual && (episodes.Count == 0 || episodes.All(i => i.IsMissingEpisode));
 
             if (item.IsMissingSeason != isMissing)
             {

+ 2 - 1
MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs

@@ -1420,8 +1420,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv
                 MediaTypes = new[] { MediaType.Video },
                 Recursive = true,
                 AncestorIds = folders.Select(i => i.Id.ToString("N")).ToArray(),
+                IsFolder = false,
                 ExcludeLocationTypes = new[] { LocationType.Virtual },
-                Limit = Math.Min(10, query.Limit ?? int.MaxValue),
+                Limit = Math.Min(200, query.Limit ?? int.MaxValue),
                 SortBy = new[] { ItemSortBy.DateCreated },
                 SortOrder = SortOrder.Descending
             });