Cleaning up

This commit is contained in:
Zoe Roux 2020-02-29 16:32:27 +01:00
parent 8c8db5e9b6
commit 253b8561bc
42 changed files with 1774 additions and 1804 deletions

View File

@ -96,18 +96,13 @@ namespace Kyoo.Models
EpisodeNumber = other.EpisodeNumber;
if (AbsoluteNumber == -1)
AbsoluteNumber = other.AbsoluteNumber;
if (Path == null)
Path = other.Path;
if (Title == null)
Title = other.Title;
if (Overview == null)
Overview = other.Overview;
if (ReleaseDate == null)
ReleaseDate = other.ReleaseDate;
Path ??= other.Path;
Title ??= other.Title;
Overview ??= other.Overview;
ReleaseDate ??= other.ReleaseDate;
if (Runtime == -1)
Runtime = other.Runtime;
if (ImgPrimary == null)
ImgPrimary = other.ImgPrimary;
ImgPrimary ??= other.ImgPrimary;
ExternalIDs += '|' + other.ExternalIDs;
return this;
}

View File

@ -26,12 +26,9 @@ namespace Kyoo.Models
{
if (other == null)
return this;
if (Slug == null)
Slug = other.Slug;
if (Name == null)
Name = other.Name;
if (ImgPrimary == null)
ImgPrimary = other.ImgPrimary;
Slug ??= other.Slug;
Name ??= other.Name;
ImgPrimary ??= other.ImgPrimary;
ExternalIDs += '|' + other.ExternalIDs;
return this;
}

View File

@ -40,14 +40,10 @@ namespace Kyoo.Models
ShowID = other.ShowID;
if (SeasonNumber == -1)
SeasonNumber = other.SeasonNumber;
if (Title == null)
Title = other.Title;
if (Overview == null)
Overview = other.Overview;
if (Year == null)
Year = other.Year;
if (ImgPrimary == null)
ImgPrimary = other.ImgPrimary;
Title ??= other.Title;
Overview ??= other.Overview;
Year ??= other.Year;
ImgPrimary ??= other.ImgPrimary;
ExternalIDs += '|' + other.ExternalIDs;
return this;
}

View File

@ -107,38 +107,20 @@ namespace Kyoo.Models
return this;
if (ID == -1)
ID = other.ID;
if (Slug == null)
Slug = other.Slug;
if (Title == null)
Title = other.Title;
if (Aliases == null)
Aliases = other.Aliases;
else
Aliases = Aliases.Concat(other.Aliases).ToArray();
if (Genres == null)
Genres = other.Genres;
else
Genres = Genres.Concat(other.Genres);
if (Path == null)
Path = other.Path;
if (Overview == null)
Overview = other.Overview;
if (TrailerUrl == null)
TrailerUrl = other.TrailerUrl;
if (Status == null)
Status = other.Status;
if (StartYear == null)
StartYear = other.StartYear;
if (EndYear == null)
EndYear = other.EndYear;
if (ImgPrimary == null)
ImgPrimary = other.ImgPrimary;
if (ImgThumb == null)
ImgThumb = other.ImgThumb;
if (ImgLogo == null)
ImgLogo = other.ImgLogo;
if (ImgBackdrop == null)
ImgBackdrop = other.ImgBackdrop;
Slug ??= other.Slug;
Title ??= other.Title;
Aliases = Aliases == null ? other.Aliases : Aliases.Concat(other.Aliases).ToArray();
Genres = Genres == null ? other.Genres : Genres.Concat(other.Genres);
Path ??= other.Path;
Overview ??= other.Overview;
TrailerUrl ??= other.TrailerUrl;
Status ??= other.Status;
StartYear ??= other.StartYear;
EndYear ??= other.EndYear;
ImgPrimary ??= other.ImgPrimary;
ImgThumb ??= other.ImgThumb;
ImgLogo ??= other.ImgLogo;
ImgBackdrop ??= other.ImgBackdrop;
ExternalIDs += '|' + other.ExternalIDs;
return this;
}