示例#1
0
        public Raw_AniDB_Creator(string sRecMessage)
        {
            // remove the header info
            string[] sDetails = sRecMessage.Substring(12).Split('|');

            // 245 CREATOR 200|?????|Suwabe Jun`ichi|1|17015.jpg||http://www.haikyo.or.jp/PROFILE/man/11470.html|Junichi_Suwabe|%E8%AB%8F%E8%A8%AA%E9%83%A8%E9%A0%86%E4%B8%80|1236300570
            // 3396|????|Takatsuka Masaya|1|24705.jpg||http://www.aoni.co.jp/actor/ta/takatsuka-masaya.html|Masaya_Takatsuka|????|1271491220

            // 235 CHARACTER
            // 0. 200 ** creator id
            // 1. ??? ** creator name kanji
            // 2. Suwabe Jun`ichi ** creator name
            // 3. 1 ** type values: 1='person', 2='company', 3='collaboration'
            // 4. 25513.jpg ** pic name
            // 5. ??? ** desc
            // 6. ??? ** URLEnglish
            // 7. ??? ** URLJapanese
            // 8. ??? ** URLWikiEnglish
            // 9. ??? ** URLWikiJapanese

            CreatorID          = int.Parse(sDetails[0].Trim());
            CreatorKanjiName   = AniDBAPILib.ProcessAniDBString(sDetails[1].Trim());
            CreatorName        = AniDBAPILib.ProcessAniDBString(sDetails[2].Trim());
            CreatorType        = AniDBAPILib.ProcessAniDBInt(AniDBAPILib.ProcessAniDBString(sDetails[3].Trim()));
            PicName            = AniDBAPILib.ProcessAniDBString(sDetails[4].Trim());
            CreatorDescription = string.Empty;
            URLEnglish         = AniDBAPILib.ProcessAniDBString(sDetails[5].Trim());
            URLJapanese        = AniDBAPILib.ProcessAniDBString(sDetails[6].Trim());
            URLWikiEnglish     = AniDBAPILib.ProcessAniDBString(sDetails[7].Trim());
            URLWikiJapanese    = AniDBAPILib.ProcessAniDBString(sDetails[8].Trim());
        }
示例#2
0
        public Raw_AniDB_Review(string sRecMessage)
        {
            // remove the header info
            string[] sDetails = sRecMessage.Substring(11).Split('|');

            // 234 REVIEW0|4||1198|18198|700|700|600|900|500|500|*EDIT* just an update, I stopped watching Naruto


            // 234 REVIEW
            // 0. 0 ** current part
            // 1. 4 ** max parts
            // 2.    ** blank
            // 3. 1198  ** review id
            // 4. 18198  ** author id
            // 5. 700  ** rating Animation
            // 6. 700  ** rating Sound
            // 7. 600  ** rating Story
            // 8. 900  ** rating Character
            // 9. 500  ** rating Value
            // 10. 500  ** rating Enjoyment
            // 11. *EDIT* just an update, I stopped watching Naruto  ** review text

            ReviewID        = int.Parse(sDetails[3].Trim());
            AuthorID        = int.Parse(sDetails[4].Trim());
            RatingAnimation = int.Parse(sDetails[5].Trim());
            RatingSound     = int.Parse(sDetails[6].Trim());
            RatingStory     = int.Parse(sDetails[7].Trim());
            RatingCharacter = int.Parse(sDetails[8].Trim());
            RatingValue     = int.Parse(sDetails[9].Trim());
            RatingEnjoyment = int.Parse(sDetails[10].Trim());
            ReviewText      = AniDBAPILib.ProcessAniDBString(sDetails[11].Trim());
        }
示例#3
0
        public Raw_AniDB_Group(string sRecMessage)
        {
            PopulateDefaults();

            // remove the header info
            string[] sDetails = sRecMessage.Substring(10).Split('|');

            //250 GROUP
            //  0. 3938 ** group id
            //  1. 704 ** rating
            //  2. 1900 ** votes
            //  3. 53 ** anime count
            //  4. 1126 ** file count
            //  5. Ayako-Fansubs ** group name
            //  6. Ayako ** short name
            //  7. #Ayako ** IRC channel
            //  8. irc.rizon.net ** IRC server
            //  9. http://ayakofansubs.info/ ** website
            // 10. 1669.png

            GroupID    = int.Parse(sDetails[0]);
            Rating     = int.Parse(sDetails[1]);
            Votes      = int.Parse(sDetails[2]);
            AnimeCount = int.Parse(sDetails[3]);
            FileCount  = int.Parse(sDetails[4]);

            GroupName      = AniDBAPILib.ProcessAniDBString(sDetails[5]);
            GroupNameShort = AniDBAPILib.ProcessAniDBString(sDetails[6]);
            IRCChannel     = AniDBAPILib.ProcessAniDBString(sDetails[7]);
            IRCServer      = AniDBAPILib.ProcessAniDBString(sDetails[8]);
            URL            = AniDBAPILib.ProcessAniDBString(sDetails[9]);
            Picname        = AniDBAPILib.ProcessAniDBString(sDetails[10]);
        }
示例#4
0
        public Raw_AniDB_NotifyAlert(string sRecMessage)
        {
            // remove the header info
            string[] sDetails = sRecMessage.Substring(14).Split('|');

            //{int4 relid}|{int4 type}|{int2 count}|{int4 date}|{str relidname}|{str fids}
            //293 NOTIFYGET
            //0. 6080
            //1. 0
            //2. 2
            //3. 1262144732
            //4. Queen`s Blade: Rurou no Senshi
            //5. 685215,685216,685210,685211,685208,685213,685214,685212,685209


            iD         = long.Parse(sDetails[0]);
            alertType  = long.Parse(sDetails[1]);
            alertCount = int.Parse(sDetails[2]);
            alertDate  = AniDBAPILib.ProcessAniDBInt(sDetails[3]);
            relName    = AniDBAPILib.ProcessAniDBString(sDetails[4]);

            string[] fids = sDetails[5].Split(',');

            foreach (string fid in fids)
            {
                long.TryParse(fid, out long lfid);
                if (lfid > 0)
                {
                    fileIDs.Add(lfid);
                }
            }
        }
示例#5
0
        /// <summary>
        /// From UDP API
        /// NO LONGER USED
        /// </summary>
        /// <param name="sRecMessage"></param>
        public Raw_AniDB_Character(string sRecMessage)
        {
            InitFields();

            this.AnimeID = 0;

            // remove the header info
            string[] sDetails = sRecMessage.Substring(14).Split('|');

            //BaseConfig.MyAnimeLog.Write("PROCESSING EPISODE: {0}", sDetails.Length);
            // 235 CHARACTER 7179|?????|Noyamano Shiraume|25513.jpg|4196,3,3875,1||1243176147


            // 235 CHARACTER
            // 0. 7179 ** char id
            // 1. ??? ** char name kanji
            // 2. Noyamano Shiraume ** char name
            // 3. 25513.jpg ** pic name
            // 4  4196,3,3875,1 ** An 'anime block' is {int anime id},{int type},{int creatorid},{boolean is_main_seiyuu} repeated as many times as necessary, separated by a single quote ( ' ).

            CharID         = int.Parse(sDetails[0].Trim());
            CharKanjiName  = AniDBAPILib.ProcessAniDBString(sDetails[1].Trim());
            CharName       = AniDBAPILib.ProcessAniDBString(sDetails[2].Trim());
            PicName        = AniDBAPILib.ProcessAniDBString(sDetails[3].Trim());
            CreatorListRaw = AniDBAPILib.ProcessAniDBString(sDetails[4].Trim().Replace("'", "|"));
        }
        // constructor
        // sRecMessage is the message received from ANIDB file info command
        public Raw_AniDB_AnimeDesc(string sRecMessage)
        {
            // remove the header info
            string[] sDetails = sRecMessage.Substring(14).Split('|');

            // 233 ANIMEDESC

            //  {int4 current part}|{int4 max parts}|{str description}
            //  0. 0 ** current part
            //  1. 1 ** max parts
            //  2. Blah blah ** description

            this.Description = AniDBAPILib.ProcessAniDBString(sDetails[2]);
        }
        // constructor
        // sRecMessage is the message received from ANIDB file info command
        public Raw_AniDB_MyListFile(string sRecMessage)
        {
            // remove the header info
            string[] sDetails = sRecMessage.Substring(11).Split('|');

            // 221 MYLIST

            //{int4 lid}|{int4 fid}|{int4 eid}|{int4 aid}|{int4 gid}|{int4 date}|{int2 state}|{int4 viewdate}|{str storage}|{str source}|{str other}|{int2 filestate}
            //  0. 66031082  ** list id
            //  1. 572794  ** file id
            //  2. 99294 ** episode id
            //  3. 6107 ** anime id
            //  4. 2723 ** group id
            //  5. 1239598714 ** fileDate
            //  6. 1 ** state
            //  7. 0  ** view date (will contain 0 if not watched, otherwise has the date it was watched)
            //  8.    ** storage
            //  9.    ** source
            // 10.    ** other
            // 11. 0  ** filestate

            this.ListID      = AniDBAPILib.ProcessAniDBInt(sDetails[0]);
            this.FileID      = AniDBAPILib.ProcessAniDBInt(sDetails[1]);
            this.EpisodeID   = AniDBAPILib.ProcessAniDBInt(sDetails[2]);
            this.AnimeID     = AniDBAPILib.ProcessAniDBInt(sDetails[3]);
            this.GroupID     = AniDBAPILib.ProcessAniDBInt(sDetails[4]);
            this.FileDate    = AniDBAPILib.ProcessAniDBString(sDetails[5]);
            this.State       = AniDBAPILib.ProcessAniDBInt(sDetails[6]);
            this.ViewDateUDP = AniDBAPILib.ProcessAniDBInt(sDetails[7]);
            this.Storage     = AniDBAPILib.ProcessAniDBString(sDetails[8]);
            this.Source      = AniDBAPILib.ProcessAniDBString(sDetails[9]);
            this.Other       = AniDBAPILib.ProcessAniDBString(sDetails[10]);
            this.FileState   = AniDBAPILib.ProcessAniDBInt(sDetails[11]);

            // calculate the watched date
            if (ViewDateUDP > 0)
            {
                DateTime utcDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
                utcDate = utcDate.AddSeconds(ViewDateUDP);

                WatchedDate = utcDate.ToLocalTime();
            }
        }
示例#8
0
        public Raw_AniDB_NotifyMessage(string sRecMessage)
        {
            // remove the header info
            string[] sDetails = sRecMessage.Substring(14).Split('|');

            //{int4 id}|{int4 from_user_id}|{str from_user_name}|{int4 date}|{int4 type}|{str title}|{str body}
            //292 NOTIFYGET
            //0. 1010180
            //1. 0
            //2. -unknown-
            //3. 1243764587
            //4. 2
            //5. Group Drop Notification - [LIME]/Amaenaide yo!! Katsu!!
            //6. This is an automated message notifying you that a group has dropped an anime<br />you were collecting.<br /><br />Group: LIME Anime [LIME] (<a href="http://anidb.net/g2182">2182</a>)<br />Anime: Amaenaide yo!! Katsu!! (<a href="http://anidb.net/a4145">4145</a>)<br /><br />marked dropped by: keitarou (1294)<br /><br />comment/reason:<br />GRANTED CREQ<br />


            iD           = long.Parse(sDetails[0]);
            fromUserID   = long.Parse(sDetails[1]);
            fromUserName = AniDBAPILib.ProcessAniDBString(sDetails[2]);
            messageDate  = AniDBAPILib.ProcessAniDBInt(sDetails[3]);
            messageType  = long.Parse(sDetails[4]);
            title        = AniDBAPILib.ProcessAniDBString(sDetails[5]);
            body         = AniDBAPILib.ProcessAniDBString(sDetails[6]);
        }
示例#9
0
        // constructor
        // sRecMessage is the message received from ANIDB file info command
        // example response like '220 FILE .....'
        public Raw_AniDB_Anime(string sRecMessage)
        {
            PopulateDefaults();

            // remove the header info
            string[] sDetails = sRecMessage.Substring(10).Split('|');

            //230 ANIME 0|0
            //  0. 6107  ** anime id
            //  1. 2009  ** year
            //  2. TV Series ** type
            //  3. 979 ** related anime id's
            //  4. 32 ** related anime types
            //  5. Magic,Shounen,Manga,Military,Action ** genres
            //  6. 6,6,6,6,4 ** genreRAW weight
            //  7. Hagane no Renkinjutsushi (2009) ** romaji name
            //  8. Kanji Name
            //  9. Full Metal Alchemist: Brotherhood ** english name
            // 10.     * other name
            // 11. FMA2'hagaren2 ** short name list (the apostrophe is the list separator)
            // 12. Fullmetal Alchemist: Brotherhood'Fullmetal Alchemist 2'Full Metal Alchemist 2'???????? ???????: ????????'St?lalkemisten'????????? ??????? ?????? : ??????'2 ????????? ??????? ??????'??????? ????? 2009'Metalinis Alchemikas 2'?????? 2009 ** synonyms
            // 13. 0 ** episodes
            // 14. 5 ** normal episode count
            // 15. 6 ** special episode count
            // 16. 1238889600 ** air date
            // 17. 0 ** end date
            // 18. http://www.hagaren.jp/ ** url
            // 19. 15097.jpg ** pic name
            // 20. 175,5,273,171,4 ** category id list
            // 21. 0 ** rating
            // 22. 0 ** vote count
            // 23. 846 ** temp rating (divide by 100)
            // 24. 416 ** temp vote count
            // 25. 0 ** average review rating
            // 26. 0 ** review count
            // 27. ** Award List
            // 28. 0 ** Restricted 18+
            // 29. 0 Anime Planet ID
            // 30. 0 ANN ID
            // 31. 0 AllCinema ID
            // 32. 0 AnimeNfo ID
            // 33. 1238889600 ** last modified
            // 34. 705,2409,2410,2411,2412,2413,2414,2415 ** character id list
            // 35. 705,2409,2410,2411,2412,2413,2414,2415 ** review id list


            AnimeID            = int.Parse(sDetails[0]);
            AnimeTypeRAW       = AniDBAPILib.ProcessAniDBString(sDetails[2]);
            RelatedAnimeIdsRAW = AniDBAPILib.ProcessAniDBString(sDetails[3]);


            //BaseConfig.MyAnimeLog.Write("relatedAnimeIDs: {0}", sDetails[3]);
            //BaseConfig.MyAnimeLog.Write("relatedAnimeIDs: {0}", AniDBLib.ProcessAniDBString(sDetails[3]));

            RelatedAnimeTypesRAW = AniDBAPILib.ProcessAniDBString(sDetails[4]);
            //genreweight = sDetails[6];
            //RomajiName = AniDBAPILib.ProcessAniDBString(sDetails[7]);
            //BaseConfig.MyAnimeLog.Write("English name old: **{0}**", sDetails[8]);
            //KanjiName = AniDBAPILib.ProcessAniDBString(sDetails[8]);
            //EnglishName = AniDBAPILib.ProcessAniDBString(sDetails[9]);
            //BaseConfig.MyAnimeLog.Write("English name new: **{0}**", englishName);
            //OtherName = AniDBAPILib.ProcessAniDBString(sDetails[10]);
            //ShortNames = AniDBAPILib.ProcessAniDBString(sDetails[11].Replace("'", "|"));
            //Synonyms = AniDBAPILib.ProcessAniDBString(sDetails[12].Replace("'", "|"));
            EpisodeCount        = AniDBAPILib.ProcessAniDBInt(sDetails[13]);
            EpisodeCountNormal  = AniDBAPILib.ProcessAniDBInt(sDetails[14]);
            EpisodeCountSpecial = AniDBAPILib.ProcessAniDBInt(sDetails[15]);

            int airDateSeconds = int.Parse(AniDBAPILib.ProcessAniDBString(sDetails[16]));
            int endDateSeconds = int.Parse(AniDBAPILib.ProcessAniDBString(sDetails[17]));

            AirDate = Commons.Utils.AniDB.GetAniDBDateAsDate(airDateSeconds);
            EndDate = Commons.Utils.AniDB.GetAniDBDateAsDate(endDateSeconds);

            URL     = AniDBAPILib.ProcessAniDBString(sDetails[18]);
            Picname = AniDBAPILib.ProcessAniDBString(sDetails[19]);
            //categoryidlist = sDetails[20];
            Rating             = AniDBAPILib.ProcessAniDBInt(sDetails[21]);
            VoteCount          = AniDBAPILib.ProcessAniDBInt(sDetails[22]);
            TempRating         = AniDBAPILib.ProcessAniDBInt(sDetails[23]);
            TempVoteCount      = AniDBAPILib.ProcessAniDBInt(sDetails[24]);
            AvgReviewRating    = AniDBAPILib.ProcessAniDBInt(sDetails[25]);
            ReviewCount        = AniDBAPILib.ProcessAniDBInt(sDetails[26]);
            AwardList          = AniDBAPILib.ProcessAniDBString(sDetails[27]);
            Restricted         = AniDBAPILib.ProcessAniDBInt(sDetails[28]);
            AnimePlanetID      = AniDBAPILib.ProcessAniDBInt(sDetails[29]);
            ANNID              = AniDBAPILib.ProcessAniDBInt(sDetails[30]);
            AllCinemaID        = AniDBAPILib.ProcessAniDBInt(sDetails[31]);
            AnimeNfoID         = AniDBAPILib.ProcessAniDBString(sDetails[32]);
            DateRecordUpdated  = AniDBAPILib.ProcessAniDBString(sDetails[33]);
            CharacterIDListRAW = AniDBAPILib.ProcessAniDBString(sDetails[34]);
            ReviewIDListRAW    = AniDBAPILib.ProcessAniDBString(sDetails[35]);
            //New version number
            VersionNumber = LastVersion;
            //Genres should by right in utf-16
            GenreRAW  = sDetails[5];
            BeginYear = AirDate.HasValue ? AirDate.Value.Year : 0;
            EndYear   = EndDate.HasValue ? EndDate.Value.Year : 0;
        }
示例#10
0
        public Raw_AniDB_File(string sRecMessage)
        {
            InitDefaultValues();

            // remove the header info
            string[] sDetails = sRecMessage.Substring(9).Split('|');

            //BaseConfig.MyAnimeLog.Write("PROCESSING FILE: {0}", sDetails.Length);

            // 220 FILE
            // 0. 572794 ** fileid
            // 1. 6107 ** anime id
            // 2. 99294 ** episode id
            // 3. 12 ** group id
            // 4. 2723 ** lid
            // 5. ** other episodes
            // 6. ** isDeprecated
            // 7. state

            // 8 ** Size
            // 9. c646d82a184a33f4e4f98af39f29a044 ** ed2k hash
            // 10. ** md5
            // 11. ** sha1
            // 12. 8452c4bf ** crc32
            // 13. high ** quality
            // 14. HDTV ** source
            // 15. Vorbis (Ogg Vorbis) ** audio codec
            // 16. 148 ** audio bit rate
            // 17. H264/AVC ** video codec
            // 18. 1773 ** video bit rate
            // 19. 1280x720 ** video res
            // 20. mkv ** file extension

            // 21. Audio Langugages.
            // 22. Subtitle languages.


            // 23. 1470 ** length in seconds
            // 24.   ** description
            // 25. 1239494400 ** release date ** date is the time of the event (in seconds since 1.1.1970)

            // 26. Episode FileName

            // 27. 2 ** episode #
            // 28. The Day It Began ** ep name
            // 29. Hajimari no Hi ** ep name romaji
            // 30. ** ep name kanji
            // 31. 712 ** episode rating (7.12)
            // 32. 14 ** episode vote count
            // 33. Eclipse Productions ** group name
            // 34. Eclipse ** group name short

            this.FileSize = long.Parse(sDetails[8].Trim());
            this.ED2KHash = AniDBAPILib.ProcessAniDBString(sDetails[9].Trim()).ToUpper();
            this.MD5      = AniDBAPILib.ProcessAniDBString(sDetails[10].Trim()).ToUpper();
            this.SHA1     = AniDBAPILib.ProcessAniDBString(sDetails[11].Trim()).ToUpper();
            this.CRC      = AniDBAPILib.ProcessAniDBString(sDetails[12].Trim()).ToUpper();
            FileID        = int.Parse(sDetails[0].Trim());
            AnimeID       = int.Parse(sDetails[1].Trim());

            int state = int.Parse(sDetails[7].Trim());

            if (state == 0 || state == 1)
            {
                FileVersion = 1;
            }
            else
            {
                AniDBFileFlags eFlags = (AniDBFileFlags)state;
                if (BitMaskHelper.IsSet(eFlags, AniDBFileFlags.FILE_ISV2))
                {
                    FileVersion = 2;
                }
                if (BitMaskHelper.IsSet(eFlags, AniDBFileFlags.FILE_ISV3))
                {
                    FileVersion = 3;
                }
                if (BitMaskHelper.IsSet(eFlags, AniDBFileFlags.FILE_ISV4))
                {
                    FileVersion = 4;
                }
                if (BitMaskHelper.IsSet(eFlags, AniDBFileFlags.FILE_ISV5))
                {
                    FileVersion = 5;
                }

                if (BitMaskHelper.IsSet(eFlags, AniDBFileFlags.FILE_CEN))
                {
                    IsCensored = 1;
                }

                IsChaptered = BitMaskHelper.IsSet(eFlags, AniDBFileFlags.FILE_CHAPTERED) ? 1 : 0;
            }

            if (int.TryParse(sDetails[6].Trim(), out int isdep))
            {
                IsDeprecated = isdep == 0 ? 0 : 1;
            }

            EpisodesRAW        = sDetails[2].Trim();
            EpisodesPercentRAW = "100";
            OtherEpisodesRAW   = string.Empty;
            if (sDetails[5].Trim().Length > 0)
            {
                string[] Eps = sDetails[5].Trim().Split('\'');
                if (Eps.Length > 0)
                {
                    foreach (string ep in Eps)
                    {
                        string[] ep2 = ep.Split(',');
                        if (ep2.Length > 0)
                        {
                            EpisodesRAW += "," + ep2[0];
                            if (!string.IsNullOrEmpty(OtherEpisodesRAW))
                            {
                                OtherEpisodesRAW += ",";
                            }
                            OtherEpisodesRAW += ep2[0];
                        }
                        if (ep2.Length > 1)
                        {
                            EpisodesPercentRAW += "," + ep2[1];
                        }
                        else
                        {
                            EpisodesPercentRAW += ",100";
                        }
                    }
                }
            }
            // Other Episodes have this format : FileId, % From The End, Per example 1030, 100 Means the complete 1030 Episode
            // 1030, 49 Means content starts at 51% of the episode 1030.

            GroupID              = int.Parse(sDetails[3].Trim());
            File_Source          = AniDBAPILib.ProcessAniDBString(sDetails[14].Trim());
            File_AudioCodec      = AniDBAPILib.ProcessAniDBString(sDetails[15].Trim());
            File_VideoCodec      = AniDBAPILib.ProcessAniDBString(sDetails[17].Trim());
            File_VideoResolution = AniDBAPILib.ProcessAniDBString(sDetails[19].Trim());
            File_FileExtension   = AniDBAPILib.ProcessAniDBString(sDetails[20].Trim());

            File_LengthSeconds = AniDBAPILib.ProcessAniDBInt(sDetails[23].Trim());
            File_Description   = AniDBAPILib.ProcessAniDBString(sDetails[24].Trim());
            File_ReleaseDate   = AniDBAPILib.ProcessAniDBInt(sDetails[25].Trim());


            LanguagesRAW = AniDBAPILib.ProcessAniDBString(sDetails[21].Trim());
            SubtitlesRAW = AniDBAPILib.ProcessAniDBString(sDetails[22].Trim());

            FileName = AniDBAPILib.ProcessAniDBString(sDetails[26].Trim());

            // mylist values
            string mlState     = sDetails[27].Trim();
            string mlFileState = sDetails[28].Trim();
            string mlViewed    = sDetails[29].Trim();
            string mlViewDate  = sDetails[30].Trim();
            string mlStorage   = sDetails[31].Trim();
            string mlSource    = sDetails[32].Trim();
            string mlOther     = sDetails[33].Trim();

            // amask
            Anime_GroupName      = AniDBAPILib.ProcessAniDBString(sDetails[40].Trim());
            Anime_GroupNameShort = AniDBAPILib.ProcessAniDBString(sDetails[41].Trim());

            IsWatched      = 0; // 0 = false, 1 = true
            Episode_Rating = AniDBAPILib.ProcessAniDBInt(sDetails[38].Trim());
            Episode_Votes  = AniDBAPILib.ProcessAniDBInt(sDetails[39].Trim());

            Version = LastVersion;
        }