[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression in integer divisions in latest movies category #501

Merged
merged 2 commits into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Emby.Server.Implementations/LiveTv/LiveTvManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ private async Task RefreshChannelsInternal(IProgress<double> progress, Cancellat
var numComplete = 0;
double progressPerService = _services.Length == 0
? 0
: 1 / _services.Length;
: 1.0 / _services.Length;

var newChannelIdList = new List<Guid>();
var newProgramIdList = new List<Guid>();
Expand Down Expand Up @@ -1262,7 +1262,7 @@ await currentChannel.RefreshMetadata(new MetadataRefreshOptions(new DirectorySer
}

numComplete++;
double percent = numComplete / allChannelsList.Count;
double percent = numComplete / (double) allChannelsList.Count;

progress.Report(85 * percent + 15);
}
Expand Down Expand Up @@ -1307,7 +1307,7 @@ private void CleanDatabaseInternal(Guid[] currentIdList, string[] validTypes, IP
}

numComplete++;
double percent = numComplete / list.Count;
double percent = numComplete / (double) list.Count;

progress.Report(100 * percent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Task Execute(CancellationToken cancellationToken, IProgress<double> progr

foreach (var file in filesToDelete)
{
double percent = index / filesToDelete.Count;
double percent = index / (double) filesToDelete.Count;

progress.Report(100 * percent);

Expand Down
2 changes: 1 addition & 1 deletion MediaBrowser.Controller/Entities/Movies/BoxSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected override bool GetBlockUnratedValue(UserPolicy config)
}

public override double GetDefaultPrimaryImageAspectRatio()
=> 2 / 3;
=> 2.0 / 3;

public override UnratedItem GetBlockUnratedType()
{
Expand Down
2 changes: 1 addition & 1 deletion MediaBrowser.Controller/Entities/Movies/Movie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public override double GetDefaultPrimaryImageAspectRatio()
return 0;
}

return 2 / 3;
return 2.0 / 3;
}

protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
Expand Down
2 changes: 1 addition & 1 deletion MediaBrowser.Controller/Entities/TV/Episode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public override double GetDefaultPrimaryImageAspectRatio()
return 0;
}

return 16 / 9;
return 16.0 / 9;
}

public override List<string> GetUserDataKeys()
Expand Down
2 changes: 1 addition & 1 deletion MediaBrowser.Controller/Entities/Trailer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public Trailer()
public TrailerType[] TrailerTypes { get; set; }

public override double GetDefaultPrimaryImageAspectRatio()
=> 2 / 3;
=> 2.0 / 3;

public override UnratedItem GetBlockUnratedType()
{
Expand Down
4 changes: 2 additions & 2 deletions MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public override double GetDefaultPrimaryImageAspectRatio()

if (string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || string.Equals(serviceName, "Next Pvr", StringComparison.OrdinalIgnoreCase))
{
return 2 / 3;
return 2.0 / 3;
}
else
{
return 16 / 9;
return 16.0 / 9;
}
}

Expand Down