mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Merge pull request #501 from hawken93/fix_division
Fix regression in integer divisions in latest movies category
This commit is contained in:
commit
67300c65dc
@ -1056,7 +1056,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||||||
var numComplete = 0;
|
var numComplete = 0;
|
||||||
double progressPerService = _services.Length == 0
|
double progressPerService = _services.Length == 0
|
||||||
? 0
|
? 0
|
||||||
: 1 / _services.Length;
|
: 1.0 / _services.Length;
|
||||||
|
|
||||||
var newChannelIdList = new List<Guid>();
|
var newChannelIdList = new List<Guid>();
|
||||||
var newProgramIdList = new List<Guid>();
|
var newProgramIdList = new List<Guid>();
|
||||||
@ -1262,7 +1262,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||||||
}
|
}
|
||||||
|
|
||||||
numComplete++;
|
numComplete++;
|
||||||
double percent = numComplete / allChannelsList.Count;
|
double percent = numComplete / (double) allChannelsList.Count;
|
||||||
|
|
||||||
progress.Report(85 * percent + 15);
|
progress.Report(85 * percent + 15);
|
||||||
}
|
}
|
||||||
@ -1307,7 +1307,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||||||
}
|
}
|
||||||
|
|
||||||
numComplete++;
|
numComplete++;
|
||||||
double percent = numComplete / list.Count;
|
double percent = numComplete / (double) list.Count;
|
||||||
|
|
||||||
progress.Report(100 * percent);
|
progress.Report(100 * percent);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||||||
|
|
||||||
foreach (var file in filesToDelete)
|
foreach (var file in filesToDelete)
|
||||||
{
|
{
|
||||||
double percent = index / filesToDelete.Count;
|
double percent = index / (double) filesToDelete.Count;
|
||||||
|
|
||||||
progress.Report(100 * percent);
|
progress.Report(100 * percent);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override double GetDefaultPrimaryImageAspectRatio()
|
public override double GetDefaultPrimaryImageAspectRatio()
|
||||||
=> 2 / 3;
|
=> 2.0 / 3;
|
||||||
|
|
||||||
public override UnratedItem GetBlockUnratedType()
|
public override UnratedItem GetBlockUnratedType()
|
||||||
{
|
{
|
||||||
|
@ -51,7 +51,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 2 / 3;
|
return 2.0 / 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
|
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
|
||||||
|
@ -111,7 +111,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 16 / 9;
|
return 16.0 / 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override List<string> GetUserDataKeys()
|
public override List<string> GetUserDataKeys()
|
||||||
|
@ -21,7 +21,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
public TrailerType[] TrailerTypes { get; set; }
|
public TrailerType[] TrailerTypes { get; set; }
|
||||||
|
|
||||||
public override double GetDefaultPrimaryImageAspectRatio()
|
public override double GetDefaultPrimaryImageAspectRatio()
|
||||||
=> 2 / 3;
|
=> 2.0 / 3;
|
||||||
|
|
||||||
public override UnratedItem GetBlockUnratedType()
|
public override UnratedItem GetBlockUnratedType()
|
||||||
{
|
{
|
||||||
|
@ -54,11 +54,11 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
|
|
||||||
if (string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || string.Equals(serviceName, "Next Pvr", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || string.Equals(serviceName, "Next Pvr", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
return 2 / 3;
|
return 2.0 / 3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 16 / 9;
|
return 16.0 / 9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user