mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fixes #595 - Linux/Unix file quantity limitation for ImagesByName/People folder
This commit is contained in:
parent
ffcfa2d858
commit
73b294b4ce
@ -244,7 +244,13 @@ namespace MediaBrowser.Model.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The width of the min movie poster.</value>
|
/// <value>The width of the min movie poster.</value>
|
||||||
public int MinMoviePosterWidth { get; set; }
|
public int MinMoviePosterWidth { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether [enable people prefix sub folders].
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if [enable people prefix sub folders]; otherwise, <c>false</c>.</value>
|
||||||
|
public bool EnablePeoplePrefixSubFolders { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
|
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -205,7 +205,7 @@ namespace MediaBrowser.Providers.Movies
|
|||||||
string url = string.Format(@"http://api.themoviedb.org/3/search/person?api_key={1}&query={0}", WebUtility.UrlEncode(person.Name), MovieDbProvider.ApiKey);
|
string url = string.Format(@"http://api.themoviedb.org/3/search/person?api_key={1}&query={0}", WebUtility.UrlEncode(person.Name), MovieDbProvider.ApiKey);
|
||||||
PersonSearchResults searchResult = null;
|
PersonSearchResults searchResult = null;
|
||||||
|
|
||||||
using (Stream json = await MovieDbProvider.Current.GetMovieDbResponse(new HttpRequestOptions
|
using (var json = await MovieDbProvider.Current.GetMovieDbResponse(new HttpRequestOptions
|
||||||
{
|
{
|
||||||
Url = url,
|
Url = url,
|
||||||
CancellationToken = cancellationToken,
|
CancellationToken = cancellationToken,
|
||||||
@ -231,15 +231,11 @@ namespace MediaBrowser.Providers.Movies
|
|||||||
{
|
{
|
||||||
var personDataPath = GetPersonDataPath(ConfigurationManager.ApplicationPaths, id);
|
var personDataPath = GetPersonDataPath(ConfigurationManager.ApplicationPaths, id);
|
||||||
|
|
||||||
Directory.CreateDirectory(personDataPath);
|
var file = Path.Combine(personDataPath, DataFileName);
|
||||||
|
|
||||||
var files = Directory.EnumerateFiles(personDataPath, "*.json", SearchOption.TopDirectoryOnly)
|
|
||||||
.Select(Path.GetFileName)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
// Only download if not already there
|
// Only download if not already there
|
||||||
// The prescan task will take care of updates so we don't need to re-download here
|
// The prescan task will take care of updates so we don't need to re-download here
|
||||||
if (!files.Contains(DataFileName, StringComparer.OrdinalIgnoreCase))
|
if (!File.Exists(file))
|
||||||
{
|
{
|
||||||
await DownloadPersonInfo(id, cancellationToken).ConfigureAwait(false);
|
await DownloadPersonInfo(id, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
@ -703,7 +703,21 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||||||
|
|
||||||
var validFilename = FileSystem.GetValidFilename(name);
|
var validFilename = FileSystem.GetValidFilename(name);
|
||||||
|
|
||||||
var key = Path.Combine(path, validFilename);
|
string subFolderPrefix = null;
|
||||||
|
|
||||||
|
if (typeof(T) == typeof(Person) && ConfigurationManager.Configuration.EnablePeoplePrefixSubFolders)
|
||||||
|
{
|
||||||
|
subFolderPrefix = validFilename.Substring(0, 1);
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(subFolderPrefix))
|
||||||
|
{
|
||||||
|
subFolderPrefix = "0";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var key = string.IsNullOrEmpty(subFolderPrefix) ?
|
||||||
|
Path.Combine(path, validFilename) :
|
||||||
|
Path.Combine(path, subFolderPrefix, validFilename);
|
||||||
|
|
||||||
BaseItem obj;
|
BaseItem obj;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user