public override void ProcessCommand()
		{
			logger.Info("Processing CommandRequest_GetReleaseGroup: {0}", GroupID);

			try
			{
				AniDB_ReleaseGroupRepository repRelGrp = new AniDB_ReleaseGroupRepository();
				AniDB_ReleaseGroup relGroup = repRelGrp.GetByGroupID(GroupID);

				if (ForceRefresh || relGroup == null)
				{
					// redownload anime details from http ap so we can get an update character list
					JMMService.AnidbProcessor.GetReleaseGroupUDP(GroupID);
				}

			}
			catch (Exception ex)
			{
				logger.Error("Error processing CommandRequest_GetReleaseGroup: {0} - {1}", GroupID, ex.ToString());
				return;
			}
		}
Example #2
0
		// NO LONGER USED
		/*public AniDB_Seiyuu GetCreatorInfoUDP(int creatorID)
		{
			if (!Login()) return null;

			enHelperActivityType ev = enHelperActivityType.NoSuchCreator;
			AniDBCommand_GetCreatorInfo getCreatorCmd = null;
			lock (lockAniDBConnections)
			{
				Pause();

				getCreatorCmd = new AniDBCommand_GetCreatorInfo();
				getCreatorCmd.Init(creatorID, true);
				ev = getCreatorCmd.Process(ref soUdp, ref remoteIpEndPoint, curSessionID, new UnicodeEncoding(true, false));
			}

			AniDB_Seiyuu chr = null;
			if (ev == enHelperActivityType.GotCreatorInfo && getCreatorCmd.CreatorInfo != null)
			{
				AniDB_CreatorRepository repCreator = new AniDB_CreatorRepository();
				chr = repCreator.GetByCreatorID(creatorID);
				if (chr == null) chr = new AniDB_Seiyuu();

				chr.Populate(getCreatorCmd.CreatorInfo);
				repCreator.Save(chr);
			}

			return chr;
		}*/

		public AniDB_ReleaseGroup GetReleaseGroupUDP(int groupID)
		{
			if (!Login()) return null;

			enHelperActivityType ev = enHelperActivityType.NoSuchGroup;
			AniDBCommand_GetGroup getCmd = null;
			lock (lockAniDBConnections)
			{
				Pause();

				getCmd = new AniDBCommand_GetGroup();
				getCmd.Init(groupID);
				SetWaitingOnResponse(true);
				ev = getCmd.Process(ref soUdp, ref remoteIpEndPoint, curSessionID, new UnicodeEncoding(true, false));
				SetWaitingOnResponse(false);
			}

			AniDB_ReleaseGroupRepository repRelGrp = new AniDB_ReleaseGroupRepository();
			AniDB_ReleaseGroup relGroup = null;
			if (ev == enHelperActivityType.GotGroup && getCmd.Group != null)
			{
				relGroup = repRelGrp.GetByGroupID(groupID);
				if (relGroup == null) relGroup = new AniDB_ReleaseGroup();

				relGroup.Populate(getCmd.Group);
				repRelGrp.Save(relGroup);
			}

			return relGroup;
		}