aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-08-15 20:41:55 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-08-15 20:41:55 -0400
commitf6dcef0cfdb4364f11836e395ff8933974bcf627 (patch)
treeea5245e54909773975185d9deabf868cf34fa445 /MediaBrowser.Server.Implementations
parente376c31436c72fa870a2c1991ff48d3543069ce0 (diff)
update recordings
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs8
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs18
2 files changed, 7 insertions, 19 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 6e5749250..f4a6385a4 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -1,6 +1,7 @@
using MediaBrowser.Common;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
+using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.LiveTv;
@@ -33,6 +34,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
private readonly TimerManager _timerProvider;
private readonly LiveTvManager _liveTvManager;
+ private IFileSystem _fileSystem;
public static EmbyTV Current;
@@ -481,14 +483,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
var recordPath = RecordingPath;
if (info.IsMovie)
{
- recordPath = Path.Combine(recordPath, "Movies", RecordingHelper.RemoveSpecialCharacters(info.Name));
+ recordPath = Path.Combine(recordPath, "Movies", _fileSystem.GetValidFilename(info.Name));
}
else
{
- recordPath = Path.Combine(recordPath, "TV", RecordingHelper.RemoveSpecialCharacters(info.Name));
+ recordPath = Path.Combine(recordPath, "TV", _fileSystem.GetValidFilename(info.Name));
}
- recordPath = Path.Combine(recordPath, RecordingHelper.GetRecordingName(timer, info));
+ recordPath = Path.Combine(recordPath, _fileSystem.GetValidFilename(RecordingHelper.GetRecordingName(timer, info)));
Directory.CreateDirectory(Path.GetDirectoryName(recordPath));
var recording = _recordingProvider.GetAll().FirstOrDefault(x => string.Equals(x.ProgramId, info.Id, StringComparison.OrdinalIgnoreCase));
diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs
index 31fb072cd..09a5a3912 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs
@@ -1,7 +1,6 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.LiveTv;
using System;
-using System.Text;
namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
{
@@ -44,7 +43,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
{
fancyName += "_(" + info.ProductionYear + ")";
}
- if (info.IsSeries)
+ if (info.IsSeries && !string.IsNullOrWhiteSpace(info.EpisodeTitle))
{
fancyName += "_" + info.EpisodeTitle.Replace("Season: ", "S").Replace(" Episode: ", "E");
}
@@ -56,20 +55,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
{
fancyName += "_" + info.OriginalAirDate.Value.ToString("yyyy-MM-dd");
}
- return RemoveSpecialCharacters(fancyName) + ".ts";
- }
-
- public static string RemoveSpecialCharacters(string str)
- {
- StringBuilder sb = new StringBuilder();
- foreach (char c in str)
- {
- if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '.' || c == '_' || c == '-' || c == ' ')
- {
- sb.Append(c);
- }
- }
- return sb.ToString();
+ return fancyName + ".ts";
}
}
}