pull/3390/head
telans 4 years ago
parent e8e5208fbd
commit afe09612e8
No known key found for this signature in database
GPG Key ID: 195444EE92DBCB20

@ -426,7 +426,7 @@ namespace Emby.Server.Implementations.HttpServer
/// </summary>
private object GetCachedResult(IRequest requestContext, IDictionary<string, string> responseHeaders, StaticResultOptions options)
{
bool noCache = (requestContext.Headers[HeaderNames.CacheControl].ToString()).IndexOf("no-cache", StringComparison.OrdinalIgnoreCase) != -1;
bool noCache = requestContext.Headers[HeaderNames.CacheControl].ToString().IndexOf("no-cache", StringComparison.OrdinalIgnoreCase) != -1;
AddCachingHeaders(responseHeaders, options.CacheDuration, noCache, options.DateLastModified);
if (!noCache)

@ -41,11 +41,11 @@ namespace Emby.Server.Implementations.HttpServer
res.Headers.Add(key, value);
}
// Try to prevent compatibility view
res.Headers["Access-Control-Allow-Headers"] = ("Accept, Accept-Language, Authorization, Cache-Control, " +
res.Headers["Access-Control-Allow-Headers"] = "Accept, Accept-Language, Authorization, Cache-Control, " +
"Content-Disposition, Content-Encoding, Content-Language, Content-Length, Content-MD5, Content-Range, " +
"Content-Type, Cookie, Date, Host, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, " +
"Origin, OriginToken, Pragma, Range, Slug, Transfer-Encoding, Want-Digest, X-MediaBrowser-Token, " +
"X-Emby-Authorization");
"X-Emby-Authorization";
if (dto is Exception exception)
{

@ -691,7 +691,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
{
var model = ModelNumber ?? string.Empty;
if ((model.IndexOf("hdtc", StringComparison.OrdinalIgnoreCase) != -1))
if (model.IndexOf("hdtc", StringComparison.OrdinalIgnoreCase) != -1)
{
return true;
}

@ -98,7 +98,7 @@ namespace Emby.Server.Implementations.Security
statement.TryBind("@AppName", info.AppName);
statement.TryBind("@AppVersion", info.AppVersion);
statement.TryBind("@DeviceName", info.DeviceName);
statement.TryBind("@UserId", (info.UserId.Equals(Guid.Empty) ? null : info.UserId.ToString("N", CultureInfo.InvariantCulture)));
statement.TryBind("@UserId", info.UserId.Equals(Guid.Empty) ? null : info.UserId.ToString("N", CultureInfo.InvariantCulture));
statement.TryBind("@UserName", info.UserName);
statement.TryBind("@IsActive", true);
statement.TryBind("@DateCreated", info.DateCreated.ToDateTimeParamValue());
@ -131,7 +131,7 @@ namespace Emby.Server.Implementations.Security
statement.TryBind("@AppName", info.AppName);
statement.TryBind("@AppVersion", info.AppVersion);
statement.TryBind("@DeviceName", info.DeviceName);
statement.TryBind("@UserId", (info.UserId.Equals(Guid.Empty) ? null : info.UserId.ToString("N", CultureInfo.InvariantCulture)));
statement.TryBind("@UserId", info.UserId.Equals(Guid.Empty) ? null : info.UserId.ToString("N", CultureInfo.InvariantCulture));
statement.TryBind("@UserName", info.UserName);
statement.TryBind("@DateCreated", info.DateCreated.ToDateTimeParamValue());
statement.TryBind("@DateLastActivity", info.DateLastActivity.ToDateTimeParamValue());

@ -302,9 +302,9 @@ namespace Emby.Server.Implementations.Services
}
// Routes with least wildcard matches get the highest score
var score = Math.Max((100 - wildcardMatchCount), 1) * 1000
var score = Math.Max(100 - wildcardMatchCount, 1) * 1000
// Routes with less variable (and more literal) matches
+ Math.Max((10 - VariableArgsCount), 1) * 100;
+ Math.Max(10 - VariableArgsCount, 1) * 100;
// Exact verb match is better than ANY
if (Verbs.Length == 1 && string.Equals(httpMethod, Verbs[0], StringComparison.OrdinalIgnoreCase))

@ -87,7 +87,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -126,7 +126,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Path;
GetPath(ref value);
return (_Path = value);
return _Path = value;
}
set
@ -163,7 +163,7 @@ namespace Jellyfin.Data.Entities
{
Enums.ArtKind value = _Kind;
GetKind(ref value);
return (_Kind = value);
return _Kind = value;
}
set

@ -82,7 +82,7 @@ namespace Jellyfin.Data.Entities
{
long? value = _ISBN;
GetISBN(ref value);
return (_ISBN = value);
return _ISBN = value;
}
set

@ -84,7 +84,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -122,7 +122,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Name;
GetName(ref value);
return (_Name = value);
return _Name = value;
}
set
@ -163,7 +163,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Language;
GetLanguage(ref value);
return (_Language = value);
return _Language = value;
}
set
@ -200,7 +200,7 @@ namespace Jellyfin.Data.Entities
{
long value = _TimeStart;
GetTimeStart(ref value);
return (_TimeStart = value);
return _TimeStart = value;
}
set
@ -233,7 +233,7 @@ namespace Jellyfin.Data.Entities
{
long? value = _TimeEnd;
GetTimeEnd(ref value);
return (_TimeEnd = value);
return _TimeEnd = value;
}
set

@ -47,7 +47,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -85,7 +85,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Name;
GetName(ref value);
return (_Name = value);
return _Name = value;
}
set

@ -91,7 +91,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set

@ -99,7 +99,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set

@ -83,7 +83,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Description;
GetDescription(ref value);
return (_Description = value);
return _Description = value;
}
set
@ -121,7 +121,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Headquarters;
GetHeadquarters(ref value);
return (_Headquarters = value);
return _Headquarters = value;
}
set
@ -159,7 +159,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Country;
GetCountry(ref value);
return (_Country = value);
return _Country = value;
}
set
@ -197,7 +197,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Homepage;
GetHomepage(ref value);
return (_Homepage = value);
return _Homepage = value;
}
set

@ -84,7 +84,7 @@ namespace Jellyfin.Data.Entities
{
int? value = _EpisodeNumber;
GetEpisodeNumber(ref value);
return (_EpisodeNumber = value);
return _EpisodeNumber = value;
}
set

@ -83,7 +83,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Outline;
GetOutline(ref value);
return (_Outline = value);
return _Outline = value;
}
set
@ -121,7 +121,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Plot;
GetPlot(ref value);
return (_Plot = value);
return _Plot = value;
}
set
@ -159,7 +159,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Tagline;
GetTagline(ref value);
return (_Tagline = value);
return _Tagline = value;
}
set

@ -80,7 +80,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -119,7 +119,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Name;
GetName(ref value);
return (_Name = value);
return _Name = value;
}
set

@ -75,7 +75,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -114,7 +114,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Name;
GetName(ref value);
return (_Name = value);
return _Name = value;
}
set

@ -57,7 +57,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -95,7 +95,7 @@ namespace Jellyfin.Data.Entities
{
Guid value = _UrlId;
GetUrlId(ref value);
return (_UrlId = value);
return _UrlId = value;
}
set
@ -132,7 +132,7 @@ namespace Jellyfin.Data.Entities
{
DateTime value = _DateAdded;
GetDateAdded(ref value);
return (_DateAdded = value);
return _DateAdded = value;
}
internal set

@ -75,7 +75,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -115,7 +115,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Path;
GetPath(ref value);
return (_Path = value);
return _Path = value;
}
set
@ -154,7 +154,7 @@ namespace Jellyfin.Data.Entities
{
string value = _NetworkPath;
GetNetworkPath(ref value);
return (_NetworkPath = value);
return _NetworkPath = value;
}
set

@ -88,7 +88,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -128,7 +128,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Path;
GetPath(ref value);
return (_Path = value);
return _Path = value;
}
set
@ -165,7 +165,7 @@ namespace Jellyfin.Data.Entities
{
Enums.MediaFileKind value = _Kind;
GetKind(ref value);
return (_Kind = value);
return _Kind = value;
}
set

@ -79,7 +79,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -116,7 +116,7 @@ namespace Jellyfin.Data.Entities
{
int value = _StreamNumber;
GetStreamNumber(ref value);
return (_StreamNumber = value);
return _StreamNumber = value;
}
set

@ -74,7 +74,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -114,7 +114,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Title;
GetTitle(ref value);
return (_Title = value);
return _Title = value;
}
set
@ -152,7 +152,7 @@ namespace Jellyfin.Data.Entities
{
string value = _OriginalTitle;
GetOriginalTitle(ref value);
return (_OriginalTitle = value);
return _OriginalTitle = value;
}
set
@ -190,7 +190,7 @@ namespace Jellyfin.Data.Entities
{
string value = _SortTitle;
GetSortTitle(ref value);
return (_SortTitle = value);
return _SortTitle = value;
}
set
@ -231,7 +231,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Language;
GetLanguage(ref value);
return (_Language = value);
return _Language = value;
}
set
@ -264,7 +264,7 @@ namespace Jellyfin.Data.Entities
{
DateTimeOffset? value = _ReleaseDate;
GetReleaseDate(ref value);
return (_ReleaseDate = value);
return _ReleaseDate = value;
}
set
@ -301,7 +301,7 @@ namespace Jellyfin.Data.Entities
{
DateTime value = _DateAdded;
GetDateAdded(ref value);
return (_DateAdded = value);
return _DateAdded = value;
}
internal set
@ -338,7 +338,7 @@ namespace Jellyfin.Data.Entities
{
DateTime value = _DateModified;
GetDateModified(ref value);
return (_DateModified = value);
return _DateModified = value;
}
internal set

@ -75,7 +75,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -114,7 +114,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Name;
GetName(ref value);
return (_Name = value);
return _Name = value;
}
set

@ -101,7 +101,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -140,7 +140,7 @@ namespace Jellyfin.Data.Entities
{
string value = _ProviderId;
GetProviderId(ref value);
return (_ProviderId = value);
return _ProviderId = value;
}
set

@ -88,7 +88,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Outline;
GetOutline(ref value);
return (_Outline = value);
return _Outline = value;
}
set
@ -126,7 +126,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Plot;
GetPlot(ref value);
return (_Plot = value);
return _Plot = value;
}
set
@ -164,7 +164,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Tagline;
GetTagline(ref value);
return (_Tagline = value);
return _Tagline = value;
}
set
@ -202,7 +202,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Country;
GetCountry(ref value);
return (_Country = value);
return _Country = value;
}
set

@ -88,7 +88,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Barcode;
GetBarcode(ref value);
return (_Barcode = value);
return _Barcode = value;
}
set
@ -126,7 +126,7 @@ namespace Jellyfin.Data.Entities
{
string value = _LabelNumber;
GetLabelNumber(ref value);
return (_LabelNumber = value);
return _LabelNumber = value;
}
set
@ -164,7 +164,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Country;
GetCountry(ref value);
return (_Country = value);
return _Country = value;
}
set

@ -83,7 +83,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -120,7 +120,7 @@ namespace Jellyfin.Data.Entities
{
Guid value = _UrlId;
GetUrlId(ref value);
return (_UrlId = value);
return _UrlId = value;
}
set
@ -159,7 +159,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Name;
GetName(ref value);
return (_Name = value);
return _Name = value;
}
set
@ -197,7 +197,7 @@ namespace Jellyfin.Data.Entities
{
string value = _SourceId;
GetSourceId(ref value);
return (_SourceId = value);
return _SourceId = value;
}
set
@ -234,7 +234,7 @@ namespace Jellyfin.Data.Entities
{
DateTime value = _DateAdded;
GetDateAdded(ref value);
return (_DateAdded = value);
return _DateAdded = value;
}
internal set
@ -271,7 +271,7 @@ namespace Jellyfin.Data.Entities
{
DateTime value = _DateModified;
GetDateModified(ref value);
return (_DateModified = value);
return _DateModified = value;
}
internal set

@ -89,7 +89,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -127,7 +127,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Role;
GetRole(ref value);
return (_Role = value);
return _Role = value;
}
set
@ -164,7 +164,7 @@ namespace Jellyfin.Data.Entities
{
Enums.PersonRoleType value = _Type;
GetType(ref value);
return (_Type = value);
return _Type = value;
}
set

@ -79,7 +79,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -116,7 +116,7 @@ namespace Jellyfin.Data.Entities
{
double value = _Value;
GetValue(ref value);
return (_Value = value);
return _Value = value;
}
set
@ -149,7 +149,7 @@ namespace Jellyfin.Data.Entities
{
int? value = _Votes;
GetVotes(ref value);
return (_Votes = value);
return _Votes = value;
}
set

@ -86,7 +86,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -124,7 +124,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Name;
GetName(ref value);
return (_Name = value);
return _Name = value;
}
set
@ -161,7 +161,7 @@ namespace Jellyfin.Data.Entities
{
double value = _MaximumValue;
GetMaximumValue(ref value);
return (_MaximumValue = value);
return _MaximumValue = value;
}
set
@ -198,7 +198,7 @@ namespace Jellyfin.Data.Entities
{
double value = _MinimumValue;
GetMinimumValue(ref value);
return (_MinimumValue = value);
return _MinimumValue = value;
}
set

@ -111,7 +111,7 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
return (_Id = value);
return _Id = value;
}
protected set
@ -150,7 +150,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Name;
GetName(ref value);
return (_Name = value);
return _Name = value;
}
set

@ -84,7 +84,7 @@ namespace Jellyfin.Data.Entities
{
int? value = _SeasonNumber;
GetSeasonNumber(ref value);
return (_SeasonNumber = value);
return _SeasonNumber = value;
}
set

@ -84,7 +84,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Outline;
GetOutline(ref value);
return (_Outline = value);
return _Outline = value;
}
set

@ -65,7 +65,7 @@ namespace Jellyfin.Data.Entities
{
DayOfWeek? value = _AirsDayOfWeek;
GetAirsDayOfWeek(ref value);
return (_AirsDayOfWeek = value);
return _AirsDayOfWeek = value;
}
set
@ -101,7 +101,7 @@ namespace Jellyfin.Data.Entities
{
DateTimeOffset? value = _AirsTime;
GetAirsTime(ref value);
return (_AirsTime = value);
return _AirsTime = value;
}
set
@ -134,7 +134,7 @@ namespace Jellyfin.Data.Entities
{
DateTimeOffset? value = _FirstAired;
GetFirstAired(ref value);
return (_FirstAired = value);
return _FirstAired = value;
}
set

@ -88,7 +88,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Outline;
GetOutline(ref value);
return (_Outline = value);
return _Outline = value;
}
set
@ -126,7 +126,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Plot;
GetPlot(ref value);
return (_Plot = value);
return _Plot = value;
}
set
@ -164,7 +164,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Tagline;
GetTagline(ref value);
return (_Tagline = value);
return _Tagline = value;
}
set
@ -202,7 +202,7 @@ namespace Jellyfin.Data.Entities
{
string value = _Country;
GetCountry(ref value);
return (_Country = value);
return _Country = value;
}
set

@ -84,7 +84,7 @@ namespace Jellyfin.Data.Entities
{
int? value = _TrackNumber;
GetTrackNumber(ref value);
return (_TrackNumber = value);
return _TrackNumber = value;
}
set

@ -225,7 +225,7 @@ namespace MediaBrowser.Controller.Entities
return null;
}
return (totalProgresses / foldersWithProgress);
return totalProgresses / foldersWithProgress;
}
protected override bool RefreshLinkedChildren(IEnumerable<FileSystemMetadata> fileSystemChildren)

@ -480,7 +480,7 @@ namespace MediaBrowser.Controller.Entities
innerProgress.RegisterAction(p =>
{
double innerPercent = currentInnerPercent;
innerPercent += p / (count);
innerPercent += p / count;
progress.Report(innerPercent);
});
@ -556,7 +556,7 @@ namespace MediaBrowser.Controller.Entities
innerProgress.RegisterAction(p =>
{
double innerPercent = currentInnerPercent;
innerPercent += p / (count);
innerPercent += p / count;
progress.Report(innerPercent);
});

@ -42,7 +42,7 @@ namespace MediaBrowser.Controller.Library
public LibraryOptions GetLibraryOptions()
{
return LibraryOptions ?? (LibraryOptions = (Parent == null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent)));
return LibraryOptions ?? (LibraryOptions = Parent == null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent));
}
/// <summary>

@ -391,7 +391,7 @@ namespace MediaBrowser.Providers.Manager
{
if (!child.IsFolder)
{
ticks += (child.RunTimeTicks ?? 0);
ticks += child.RunTimeTicks ?? 0;
}
}

Loading…
Cancel
Save