瀏覽代碼

Add Options to disable DVR NFO and image saving

- SaveRecordingNFO and SaveRecordingImages default to true. Maintains current behavior.
- Episode.FillMissingEpisodeNumbersFromPath for live tv so external metadata can be pulled when recording starts.
SenorSmartyPants 2 年之前
父節點
當前提交
159a244654

+ 17 - 11
Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs

@@ -1814,21 +1814,27 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
                     program.AddGenre("News");
                 }
 
-                if (timer.IsProgramSeries)
+                if (GetConfiguration().SaveRecordingNFO)
                 {
-                    await SaveSeriesNfoAsync(timer, seriesPath).ConfigureAwait(false);
-                    await SaveVideoNfoAsync(timer, recordingPath, program, false).ConfigureAwait(false);
-                }
-                else if (!timer.IsMovie || timer.IsSports || timer.IsNews)
-                {
-                    await SaveVideoNfoAsync(timer, recordingPath, program, true).ConfigureAwait(false);
+                    if (timer.IsProgramSeries)
+                    {
+                        await SaveSeriesNfoAsync(timer, seriesPath).ConfigureAwait(false);
+                        await SaveVideoNfoAsync(timer, recordingPath, program, false).ConfigureAwait(false);
+                    }
+                    else if (!timer.IsMovie || timer.IsSports || timer.IsNews)
+                    {
+                        await SaveVideoNfoAsync(timer, recordingPath, program, true).ConfigureAwait(false);
+                    }
+                    else
+                    {
+                        await SaveVideoNfoAsync(timer, recordingPath, program, false).ConfigureAwait(false);
+                    }
                 }
-                else
+
+                if (GetConfiguration().SaveRecordingImages)
                 {
-                    await SaveVideoNfoAsync(timer, recordingPath, program, false).ConfigureAwait(false);
+                    await SaveRecordingImages(recordingPath, program).ConfigureAwait(false);
                 }
-
-                await SaveRecordingImages(recordingPath, program).ConfigureAwait(false);
             }
             catch (Exception ex)
             {

+ 1 - 1
MediaBrowser.Controller/Entities/TV/Episode.cs

@@ -320,7 +320,7 @@ namespace MediaBrowser.Controller.Entities.TV
 
             if (!IsLocked)
             {
-                if (SourceType == SourceType.Library)
+                if (SourceType == SourceType.Library || SourceType == SourceType.LiveTV)
                 {
                     try
                     {

+ 4 - 0
MediaBrowser.Model/LiveTv/LiveTvOptions.cs

@@ -40,5 +40,9 @@ namespace MediaBrowser.Model.LiveTv
         public string RecordingPostProcessor { get; set; }
 
         public string RecordingPostProcessorArguments { get; set; }
+
+        public bool SaveRecordingNFO { get; set; } = true;
+
+        public bool SaveRecordingImages { get; set; } = true;
     }
 }