public void Save(CrossRef_AniDB_TvDB_Episode obj)
		{
			using (var session = JMMService.SessionFactory.OpenSession())
			{
				// populate the database
				using (var transaction = session.BeginTransaction())
				{
					session.SaveOrUpdate(obj);
					transaction.Commit();
				}
			}
		}
Exemplo n.º 2
0
		public static void LinkAniDBTvDBEpisode(int aniDBID, int tvDBID, int animeID)
		{
			CrossRef_AniDB_TvDB_EpisodeRepository repCrossRef = new CrossRef_AniDB_TvDB_EpisodeRepository();
			CrossRef_AniDB_TvDB_Episode xref = repCrossRef.GetByAniDBEpisodeID(aniDBID);
			if (xref == null)
				xref = new CrossRef_AniDB_TvDB_Episode();

			xref.AnimeID = animeID;
			xref.AniDBEpisodeID = aniDBID;
			xref.TvDBEpisodeID = tvDBID;
			repCrossRef.Save(xref);

			StatsCache.Instance.UpdateUsingAnime(animeID);

			logger.Trace("Changed tvdb episode association: {0}", aniDBID);
		}
Exemplo n.º 3
0
        public static void LinkAniDBTvDBEpisode(int aniDBID, int tvDBID, int animeID)
        {
            CrossRef_AniDB_TvDB_Episode xref = RepoFactory.CrossRef_AniDB_TvDB_Episode.GetByAniDBEpisodeID(aniDBID);
            if (xref == null)
                xref = new CrossRef_AniDB_TvDB_Episode();

            xref.AnimeID = animeID;
            xref.AniDBEpisodeID = aniDBID;
            xref.TvDBEpisodeID = tvDBID;
            RepoFactory.CrossRef_AniDB_TvDB_Episode.Save(xref);

            AniDB_Anime.UpdateStatsByAnimeID(animeID);

            AnimeEpisode ep = RepoFactory.AnimeEpisode.GetByAniDBEpisodeID(aniDBID);
            RepoFactory.AnimeEpisode.Save(ep);

            logger.Trace("Changed tvdb episode association: {0}", aniDBID);
        }