mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-24 02:54:43 +01:00
add image download setting
This commit is contained in:
@@ -729,6 +729,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
var recordingFileName = _fileSystem.GetValidFilename(RecordingHelper.GetRecordingName(timer, info)).Trim() + ".ts";
|
||||
|
||||
recordPath = Path.Combine(recordPath, recordingFileName);
|
||||
recordPath = EnsureFileUnique(recordPath);
|
||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(recordPath));
|
||||
|
||||
var recordingId = info.Id.GetMD5().ToString("N");
|
||||
@@ -862,6 +863,24 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
}
|
||||
}
|
||||
|
||||
private string EnsureFileUnique(string path)
|
||||
{
|
||||
var originalPath = path;
|
||||
var index = 1;
|
||||
|
||||
while (_fileSystem.FileExists(path))
|
||||
{
|
||||
var parent = Path.GetDirectoryName(originalPath);
|
||||
var name = Path.GetFileNameWithoutExtension(originalPath);
|
||||
name += "-" + index.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
path = Path.ChangeExtension(Path.Combine(parent, name), Path.GetExtension(originalPath));
|
||||
index++;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
private async Task<IRecorder> GetRecorder()
|
||||
{
|
||||
if (GetConfiguration().EnableRecordingEncoding)
|
||||
|
||||
Reference in New Issue
Block a user