Permalink
Browse files

[F] Series Insert error when Manually Linking

  • Loading branch information...
da3dsoul committed Jul 27, 2018
1 parent a616049 commit 9d73fd817af7bf11e03a5e192198446d9a3558e6
@@ -2249,7 +2249,7 @@ public CL_Response<CL_AnimeSeries_User> CreateSeriesFromAnime(int animeID, int?
}

logger.Debug("Creating groups, series and episodes....");
if (ser == null) ser = anime.CreateAnimeSeriesAndGroup(animeGroupID);
ser = anime.CreateAnimeSeriesAndGroup(ser, animeGroupID);

ser.CreateAnimeEpisodes();

@@ -794,18 +794,18 @@ private bool Populate(Raw_AniDB_Anime animeInfo)
return true;
}

public SVR_AnimeSeries CreateAnimeSeriesAndGroup(int? existingGroupID = null)
public SVR_AnimeSeries CreateAnimeSeriesAndGroup(SVR_AnimeSeries existingSeries = null, int? existingGroupID = null)
{
using (var session = DatabaseFactory.SessionFactory.OpenSession())
{
return CreateAnimeSeriesAndGroup(session.Wrap(), existingGroupID);
return CreateAnimeSeriesAndGroup(session.Wrap(), existingSeries, existingGroupID);
}
}

public SVR_AnimeSeries CreateAnimeSeriesAndGroup(ISessionWrapper session, int? existingGroupID = null)
public SVR_AnimeSeries CreateAnimeSeriesAndGroup(ISessionWrapper session, SVR_AnimeSeries existingSeries = null, int? existingGroupID = null)
{
// Create a new AnimeSeries record
SVR_AnimeSeries series = new SVR_AnimeSeries();
SVR_AnimeSeries series = existingSeries ?? new SVR_AnimeSeries();

series.Populate(this);
// Populate before making a group to ensure IDs and stats are set for group filters.

0 comments on commit 9d73fd8

Please sign in to comment.