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; EpisodeNumber = other.EpisodeNumber;
if (AbsoluteNumber == -1) if (AbsoluteNumber == -1)
AbsoluteNumber = other.AbsoluteNumber; AbsoluteNumber = other.AbsoluteNumber;
if (Path == null) Path ??= other.Path;
Path = other.Path; Title ??= other.Title;
if (Title == null) Overview ??= other.Overview;
Title = other.Title; ReleaseDate ??= other.ReleaseDate;
if (Overview == null)
Overview = other.Overview;
if (ReleaseDate == null)
ReleaseDate = other.ReleaseDate;
if (Runtime == -1) if (Runtime == -1)
Runtime = other.Runtime; Runtime = other.Runtime;
if (ImgPrimary == null) ImgPrimary ??= other.ImgPrimary;
ImgPrimary = other.ImgPrimary;
ExternalIDs += '|' + other.ExternalIDs; ExternalIDs += '|' + other.ExternalIDs;
return this; return this;
} }

View File

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

View File

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

View File

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