It aint pretty, but it works.
This commit is contained in:
parent
a984859770
commit
b5e1e7eddd
1 changed files with 10 additions and 5 deletions
|
|
@ -1629,15 +1629,15 @@ public class ExternalMetadataService : IExternalMetadataService
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the series should be marked as completed, checks loosy with #chapters and #series; Also tries
|
||||
/// to use specials to reach the required amount
|
||||
/// Returns true if the series should be marked as completed, checks loosey with chapter and series numbers.
|
||||
/// Respects Specials to reach the required amount.
|
||||
/// </summary>
|
||||
/// <param name="series"></param>
|
||||
/// <param name="chapters"></param>
|
||||
/// <param name="externalMetadata"></param>
|
||||
/// <param name="maxVolumes"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>Updates MaxCount and TotalCount if a loosy check is used to set as completed</remarks>
|
||||
/// <remarks>Updates MaxCount and TotalCount if a loosey check is used to set as completed</remarks>
|
||||
public static bool IsSeriesCompleted(Series series, List<Chapter> chapters, ExternalSeriesDetailDto externalMetadata, int maxVolumes)
|
||||
{
|
||||
// A series is completed if exactly the amount is found
|
||||
|
|
@ -1653,7 +1653,12 @@ public class ExternalMetadataService : IExternalMetadataService
|
|||
// Note: I've currently opted to keep this an equals to prevent the above bug from happening
|
||||
// We *could* change this to >= in the future in case this is reported by users
|
||||
// If we do; test IsSeriesCompleted_Volumes_TooManySpecials needs to be updated
|
||||
if (maxVolumes != Parser.DefaultChapterNumber && series.Volumes.Count == externalMetadata.Volumes)
|
||||
|
||||
// Note: If Kavita has specials, we should be lenient and ignore for the volume check
|
||||
var volumeModifier = series.Volumes.Any(v => v.Name == Parser.SpecialVolume) ? 1 : 0;
|
||||
var modifiedMinVolumeCount = series.Volumes.Count - volumeModifier;
|
||||
if (maxVolumes != Parser.DefaultChapterNumber &&
|
||||
(externalMetadata.Volumes == series.Volumes.Count || externalMetadata.Volumes == modifiedMinVolumeCount))
|
||||
{
|
||||
series.Metadata.MaxCount = series.Volumes.Count;
|
||||
series.Metadata.TotalCount = series.Volumes.Count;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue