Exemplo n.º 1
0
        public void Populate(AniDB_FileRequest data)
        {
            this.Anime_GroupName      = data.Anime_GroupName;
            this.Anime_GroupNameShort = data.Anime_GroupNameShort;
            this.AnimeID              = data.AnimeID;
            this.CRC                  = data.CRC;
            this.Episode_Rating       = data.Episode_Rating;
            this.Episode_Votes        = data.Episode_Votes;
            this.File_AudioCodec      = data.File_AudioCodec;
            this.File_Description     = data.File_Description;
            this.File_FileExtension   = data.File_FileExtension;
            this.File_LengthSeconds   = data.File_LengthSeconds;
            this.File_ReleaseDate     = data.File_ReleaseDate;
            this.File_Source          = data.File_Source;
            this.File_VideoCodec      = data.File_VideoCodec;
            this.File_VideoResolution = data.File_VideoResolution;
            this.FileID               = data.FileID;
            this.FileName             = data.FileName;
            this.FileSize             = data.FileSize;
            this.GroupID              = data.GroupID;
            this.Hash                 = data.Hash;
            this.MD5                  = data.MD5;
            this.SHA1                 = data.SHA1;

            this.SubtitlesRAW       = data.SubtitlesRAW;
            this.LanguagesRAW       = data.LanguagesRAW;
            this.EpisodesRAW        = data.EpisodesRAW;
            this.EpisodesPercentRAW = data.EpisodesPercentRAW;

            this.DateTimeUpdated = DateTime.Now;
        }
Exemplo n.º 2
0
        public void Populate(AniDB_FileRequest fileInfo)
        {
            this.Anime_GroupName      = fileInfo.Anime_GroupName;
            this.Anime_GroupNameShort = fileInfo.Anime_GroupNameShort;
            this.AnimeID              = fileInfo.AnimeID;
            this.CRC                  = fileInfo.CRC;
            this.DateTimeUpdated      = DateTime.Now;
            this.Episode_Rating       = fileInfo.Episode_Rating;
            this.Episode_Votes        = fileInfo.Episode_Votes;
            this.File_AudioCodec      = fileInfo.File_AudioCodec;
            this.File_Description     = fileInfo.File_Description;
            this.File_FileExtension   = fileInfo.File_FileExtension;
            this.File_LengthSeconds   = fileInfo.File_LengthSeconds;
            this.File_ReleaseDate     = fileInfo.File_ReleaseDate;
            this.File_Source          = fileInfo.File_Source;
            this.File_VideoCodec      = fileInfo.File_VideoCodec;
            this.File_VideoResolution = fileInfo.File_VideoResolution;
            this.FileID               = fileInfo.FileID;
            this.FileName             = fileInfo.FileName;
            this.FileSize             = fileInfo.FileSize;
            this.GroupID              = fileInfo.GroupID;
            this.Hash                 = fileInfo.Hash;
            this.MD5                  = fileInfo.MD5;
            this.SHA1                 = fileInfo.SHA1;

            this.FileVersion     = 1;
            this.IsCensored      = 0;
            this.IsDeprecated    = 0;
            this.InternalVersion = 0;

            this.languagesRAW       = fileInfo.LanguagesRAW;
            this.subtitlesRAW       = fileInfo.SubtitlesRAW;
            this.episodesPercentRAW = fileInfo.EpisodesPercentRAW;
            this.episodesRAW        = fileInfo.EpisodesRAW;
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.ContentType = "text/xml";

            try
            {
                Response.Write(Constants.ERROR_XML);
                return;

                string sfsize = Utils.GetParam("fsize");
                long   fsize  = 0;
                long.TryParse(sfsize, out fsize);

                if (fsize <= 0)
                {
                    Response.Write(Constants.ERROR_XML);
                    return;
                }

                string hash = Utils.GetParam("hash");
                if (hash.Trim().Length == 0)
                {
                    Response.Write(Constants.ERROR_XML);
                    return;
                }

                AniDB_FileRepository rep = new AniDB_FileRepository();

                AniDB_File anifile = rep.GetByHashAndFileSize(hash, fsize);
                if (anifile == null)
                {
                    Response.Write(Constants.ERROR_XML);
                    return;
                }

                AniDB_FileRequest data = new AniDB_FileRequest(anifile);
                string            ret  = Utils.ConvertToXML(data, typeof(AniDB_FileRequest));

                Response.Write(ret);
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
                return;
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.ContentType = "text/xml";

            try
            {
                Response.Write(Constants.ERROR_XML);
                return;

                AniDB_FileRepository rep = new AniDB_FileRepository();

                StreamReader reader  = new StreamReader(this.Request.InputStream);
                String       xmlData = reader.ReadToEnd();

                XmlSerializer serializer      = new XmlSerializer(typeof(AniDB_FileRequest));
                XmlDocument   docSearchResult = new XmlDocument();
                docSearchResult.LoadXml(xmlData);

                XmlNodeReader     xmlreader = new XmlNodeReader(docSearchResult.DocumentElement);
                object            obj       = serializer.Deserialize(xmlreader);
                AniDB_FileRequest result    = (AniDB_FileRequest)obj;


                if (result == null)
                {
                    Response.Write(Constants.ERROR_XML);
                    return;
                }


                AniDB_File anifile = rep.GetByFileID(result.FileID);
                if (anifile == null)
                {
                    anifile = new AniDB_File();
                }

                anifile.Populate(result);
                rep.Save(anifile);
            }
            catch (Exception ex)
            {
                Response.Write(Constants.ERROR_XML);
            }
        }