mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 09:04:42 +01:00
Merge branch 'master' into culture
This commit is contained in:
@@ -63,7 +63,8 @@ namespace MediaBrowser.Controller.Drawing
|
||||
case ImageType.Logo:
|
||||
return 2.58;
|
||||
case ImageType.Primary:
|
||||
return item.GetDefaultPrimaryImageAspectRatio();
|
||||
double defaultPrimaryImageAspectRatio = item.GetDefaultPrimaryImageAspectRatio();
|
||||
return defaultPrimaryImageAspectRatio > 0 ? defaultPrimaryImageAspectRatio : 2.0 / 3;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@@ -228,7 +229,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return Path;
|
||||
}
|
||||
|
||||
return FileSystem.GetDirectoryName(Path);
|
||||
return System.IO.Path.GetDirectoryName(Path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1518,7 +1519,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public virtual double GetDefaultPrimaryImageAspectRatio()
|
||||
{
|
||||
return 2.0 / 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public virtual string CreatePresentationUniqueKey()
|
||||
@@ -2208,7 +2209,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var allFiles = ImageInfos
|
||||
.Where(i => i.IsLocalFile)
|
||||
.Select(i => FileSystem.GetDirectoryName(i.Path))
|
||||
.Select(i => System.IO.Path.GetDirectoryName(i.Path))
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.SelectMany(i => directoryService.GetFilePaths(i))
|
||||
.ToList();
|
||||
@@ -2343,7 +2344,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
var newImagePaths = images.Select(i => i.FullName).ToList();
|
||||
|
||||
var deleted = existingImages
|
||||
.Where(i => i.IsLocalFile && !newImagePaths.Contains(i.Path, StringComparer.OrdinalIgnoreCase) && !FileSystem.FileExists(i.Path))
|
||||
.Where(i => i.IsLocalFile && !newImagePaths.Contains(i.Path, StringComparer.OrdinalIgnoreCase) && !File.Exists(i.Path))
|
||||
.ToList();
|
||||
|
||||
if (deleted.Count > 0)
|
||||
@@ -2396,7 +2397,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
var extensions = new List<string> { ".nfo", ".xml", ".srt", ".vtt", ".sub", ".idx", ".txt", ".edl", ".bif", ".smi", ".ttml" };
|
||||
extensions.AddRange(SupportedImageExtensions);
|
||||
|
||||
return FileSystem.GetFiles(FileSystem.GetDirectoryName(Path), extensions.ToArray(), false, false)
|
||||
return FileSystem.GetFiles(System.IO.Path.GetDirectoryName(Path), extensions.ToArray(), false, false)
|
||||
.Where(i => System.IO.Path.GetFileNameWithoutExtension(i.FullName).StartsWith(filename, StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
}
|
||||
@@ -2508,7 +2509,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(Path))
|
||||
{
|
||||
Name = FileSystem.GetFileNameWithoutExtension(Path);
|
||||
Name = System.IO.Path.GetFileNameWithoutExtension(Path);
|
||||
hasChanges = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return new[] {
|
||||
new FileSystemMetadata
|
||||
{
|
||||
FullName = FileSystem.GetDirectoryName(Path),
|
||||
FullName = System.IO.Path.GetDirectoryName(Path),
|
||||
IsDirectory = true
|
||||
}
|
||||
};
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
return series.Path;
|
||||
}
|
||||
|
||||
return FileSystem.GetDirectoryName(Path);
|
||||
return System.IO.Path.GetDirectoryName(Path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@@ -167,18 +168,18 @@ namespace MediaBrowser.Controller.Entities
|
||||
var oldConfigurationDirectory = ConfigurationDirectoryPath;
|
||||
|
||||
// Exceptions will be thrown if these paths already exist
|
||||
if (FileSystem.DirectoryExists(newConfigDirectory))
|
||||
if (Directory.Exists(newConfigDirectory))
|
||||
{
|
||||
FileSystem.DeleteDirectory(newConfigDirectory, true);
|
||||
Directory.Delete(newConfigDirectory, true);
|
||||
}
|
||||
|
||||
if (FileSystem.DirectoryExists(oldConfigurationDirectory))
|
||||
if (Directory.Exists(oldConfigurationDirectory))
|
||||
{
|
||||
FileSystem.MoveDirectory(oldConfigurationDirectory, newConfigDirectory);
|
||||
Directory.Move(oldConfigurationDirectory, newConfigDirectory);
|
||||
}
|
||||
else
|
||||
{
|
||||
FileSystem.CreateDirectory(newConfigDirectory);
|
||||
Directory.CreateDirectory(newConfigDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
if (IsStacked)
|
||||
{
|
||||
return FileSystem.GetDirectoryName(Path);
|
||||
return System.IO.Path.GetDirectoryName(Path);
|
||||
}
|
||||
|
||||
if (!IsPlaceHolder)
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace MediaBrowser.Controller.Library
|
||||
return false;
|
||||
}
|
||||
|
||||
var parentDir = BaseItem.FileSystem.GetDirectoryName(Path) ?? string.Empty;
|
||||
var parentDir = System.IO.Path.GetDirectoryName(Path) ?? string.Empty;
|
||||
|
||||
return parentDir.Length > _appPaths.RootFolderPath.Length
|
||||
&& parentDir.StartsWith(_appPaths.RootFolderPath, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
@@ -434,7 +434,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
if (string.Equals(Path.GetExtension(subtitlePath), ".sub", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var idxFile = Path.ChangeExtension(subtitlePath, ".idx");
|
||||
if (_fileSystem.FileExists(idxFile))
|
||||
if (File.Exists(idxFile))
|
||||
{
|
||||
subtitlePath = idxFile;
|
||||
}
|
||||
@@ -542,7 +542,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
// var fallbackFontPath = Path.Combine(_appPaths.ProgramDataPath, "fonts", "DroidSansFallback.ttf");
|
||||
// string fallbackFontParam = string.Empty;
|
||||
|
||||
// if (!_fileSystem.FileExists(fallbackFontPath))
|
||||
// if (!File.Exists(fallbackFontPath))
|
||||
// {
|
||||
// _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(fallbackFontPath));
|
||||
// using (var stream = _assemblyInfo.GetManifestResourceStream(GetType(), GetType().Namespace + ".DroidSansFallback.ttf"))
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.Playlists
|
||||
|
||||
if (IsPlaylistFile(path))
|
||||
{
|
||||
return FileSystem.GetDirectoryName(path);
|
||||
return System.IO.Path.GetDirectoryName(path);
|
||||
}
|
||||
|
||||
return path;
|
||||
|
||||
@@ -15,11 +15,6 @@ namespace MediaBrowser.Controller.Subtitles
|
||||
/// </summary>
|
||||
event EventHandler<SubtitleDownloadFailureEventArgs> SubtitleDownloadFailure;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [subtitles downloaded].
|
||||
/// </summary>
|
||||
event EventHandler<SubtitleDownloadEventArgs> SubtitlesDownloaded;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the parts.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user